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

How does com provide language transparency?

600


Explain stack & heap objects?

626


Why can templates only be implemented in the header file?

656


What is class invariant in c++?

741


Explain differences between new() and delete()?

616






Explain deep copy?

604


What are maps in c++?

502


What is the prototype of printf function?

643


Can circle be called an ellipse?

630


Why we use #include conio h in c++?

591


How do you master coding?

558


Explain the different access specifiers for the class member in c++.

544


What are the advantages of pointers?

593


What is pure virtual function?

621


What are the five basic elements of a c++ program?

576