Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!olivea!uunet!bywater!arnor!watson!blinn.watson.ibm.com!mittle From: mittle@blinn.watson.ibm.com (Josh Mittleman) Newsgroups: comp.lang.c++ Subject: Re: Help needed in c++ Message-ID: <1991Jun19.171504.25707@watson.ibm.com> Date: 19 Jun 91 17:15:04 GMT References: <3257@odin.cs.hw.ac.uk> Sender: @watson.ibm.com Organization: IBM T. J. Watson Research Lines: 20 In article <3257@odin.cs.hw.ac.uk>, marina@cs.hw.ac.uk (Marina Georgiadou) writes: > class A{ > // ... > public : > virtual int f() const; > //... > }; > Does anybody know the meaning of this const postfix ?? It indicates that the member function will not modify *this. It allows the member function to be safely applied to a const object. Invoking a non-const member function on a const object is an error. See ARM p.177 for details. =========================================================================== Josh Mittleman (mittle@watson.ibm.com or joshua@paul.rutgers.edu) J2-C28 T.J. Watson Research Center, PO Box 704, Yorktown Heights, NY 10598