C++ const member functions

Thursday, June 24, 2010

  1. A const member function is a function which will not modify any member of the class it belongs to (specifically members which are not declared static).
  2. A const member function can change members of its container class that are defined as mutable.
  3. A const member function, if it calls a non-const member function, which modifies class members, compiler will throw an error.

0 comments: