Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!olivea!genie!udel!rochester!kodak!ispd-newsserver!ism.isc.com!b1!ico!auto-trol!mattel From: mattel@auto-trol.com (Matt Telles) Newsgroups: comp.lang.c++ Subject: Re: Help needed in c++ Message-ID: <1991Jun19.141917.18345@auto-trol.com> Date: 19 Jun 91 14:19:17 GMT References: <3257@odin.cs.hw.ac.uk> Sender: news@auto-trol.com Organization: Auto-trol Lines: 34 Nntp-Posting-Host: mattel In article <3257@odin.cs.hw.ac.uk> marina@cs.hw.ac.uk (Marina Georgiadou) writes: > >I'm currently working in Borland C++, and I have encountered >the following construct in one of Borland's examples : > >class A{ >// ... >public : > virtual int f() const; >//... >}; > >Does anybody know the meaning of this const postfix ?? Funny you should mention this. We are arguing about using these at work. The const postfix notation indicates that the method (f) does NOT modify the object for which it is messaged (this). In other words, if I have an object x of class A, then doing: x.f() is GUARANTEED not to change x in any way. What do other people think of using this notation? Is it useful? Are there any side effects? Matt -- ============================================================================== Matt Telles mattel@auto-trol.COM {...}ncar!ico!auto-trol!mattel Auto-trol Technology 12500 N Washington Denver, CO 80241-2404 (303)252-2874