What is a mutable member?

Answer Posted / nimish singh

One that can be modified by the class even when the object of the class or the member function doing the modification is const.

Understanding this requirement implies an understanding of C++ const, which many programmers do not have. I have seen large class designs that do not employ the const qualifier anywhere. Some of those designs are my own early C++ efforts. One author suggests that some programmers find const to be such a bother that it is easier to ignore const than to try to use it meaningfully. No wonder many programmers don't understand the power and implications of const. Someone who claims to have enough interest in the language and its evolution to keep pace with the ANSI deliberations should not be ignorant of const, however.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we use #include iostream in c++?

811


Which should be more useful: the protected and public virtuals?

808


What are c++ manipulators?

845


Why cout is used in c++?

800


How can you differentiate between inheritance and implementation in c++?

953


Which bit wise operator is suitable for checking whether a particular bit is on or off?

837


Which software is used to run c++ program?

769


Explain "const" reference arguments in function?

849


Define vptr.

810


Is it legal in c++ to overload operator++ so that it decrements a value in your class?

858


Does improper inheritance have a potential to wreck a project?

906


Explain Memory Allocation in C/C++ ?

849


Explain the differences between private, public and protected and give examples.

810


If a base class is an adt, and it has three pure virtual functions, how many of these functions must be overridden in its derived classes?

849


Do you know what are pure virtual functions?

926