What is a mutable member?



What is a mutable member?..

Answer / 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

More C++ General Interview Questions

What is meant by iomanip in c++?

1 Answers  


I was a c++ code and was asked to find out the bug in that. The bug was that he declared an object locally in a function and tried to return the pointer to that object. Since the object is local to the function, it no more exists after returning from the function. The pointer, therefore, is invalid outside.

1 Answers  


What is a manipulator in c++?

1 Answers  


What are the basics of local (auto) objects?

1 Answers  


Is there a c++ certification?

1 Answers  


How would you use the functions randomize() and random()?

1 Answers  


What is c++ and its uses?

1 Answers  


What is token c++?

1 Answers  


What is the function of I/O library in C++ ?

1 Answers   HCL,


Differentiate between a pointer and a reference with respect to c++.

1 Answers  


What are the advantages of c++?

4 Answers  


What are virtual functions in c++?

1 Answers  


Categories