Tuesday, August 1, 2017

C++ const

const member function
A "const function", denoted with the keyword const after a function declaration, makes it a compiler error for this class function to change a member variable of the class.
To allow some of the variables to be writable even when the function is marked as a "const function", these class variables are marked with the keyword mutable.

Wikipedia:

pointers and references
methods (member functions)

No comments:

Post a Comment