On Thu, 18 Aug 2005 10:51:34 +0200, "Christian Meier" <chris@gmx.ch>
wrote in comp.lang.c++:
[color=blue]
> <gevadas@gmail.com> schrieb im Newsbeitrag
> news:1124354434.981058.279130@g47g2000cwa.googlegr oups.com...[color=green]
> > Const at the end of function tells the compiler that your function wont
> > modify any private variables of the class.You can only use these
> > functions with const objects.
> >
> > Gevadas A. Akkara
> >[/color]
>
> Not only private members.
> const after function name makes the this-pointer const. So you are not
> allowed to change a member variable in this function.[/color]
I hope you mean:
The const keyword after a member function name makes the object *this
constant inside the function.
'this' itself is always constant.
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html