p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional C++, 2nd Edition (http://p2p.wrox.com/forumdisplay.php?f=661)
-   -   About code on page 182 (http://p2p.wrox.com/showthread.php?t=86871)

40tude March 3rd, 2012 05:42 PM

About code on page 182
 
Bonjour,
On the top of the page 182, in the fisrt code snippet, one of the line reads :

int getId() const;

I have issue with this specific line
Indeed I do not understand the use of "const" on this line
Could one of you help me understand the line (I may have missed one point somewhere)

Best regards, Philippe

40tude March 3rd, 2012 06:05 PM

Forget my question
I knew it was a bad idea

Const is there because getId is an Inspector
See p 33 for details if needed

Sorry for the post.
Regards, Philippe

Marc Gregoire March 4th, 2012 11:30 AM

Correct, getId() is an inspector and does not change any data members of the class, so it's const.


All times are GMT -4. The time now is 10:31 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.