Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the use of mutable key word?

key mutable word
0
Posted

What is the use of mutable key word?

0

This keyword can only be applied to non-static and non- const data members of a class. If a data member is declared mutable, then it is legal to assign a value to this data member from a const member function. if u write a class do u write Assignment operator and copy constructor Compiler provide the assignment operator/ copy constructor by default. The assignment operator and copy constructor do the bit wise copy of the object. If user want to do the member wise copy(ex:allocating the memory from the heap) for the members, one can write his/her own assignment operator/ copy constructor.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123