Saturday 23 June 2012

What feature of C++ would you use if you wanted to design a member function that guarantees to leave "this" object unchanged?

Member function that is declared as const.

Const objects can call only const methods.
Non-const objects can call both const and non-const methods.

No comments:

Post a Comment