4 ms·
I dont see that as being a breaking change. In both cases its wrong to mutate the object in the const member, Its just in C++98 no one _explicitly_ told you tha
by dkhenry 13y ago
I dont see that as being a breaking change. In both cases its wrong to mutate the object in the const member, Its just in C++98 no one _explicitly_ told you that. Maybe we should spell other good programming practices out for you so you can start following them before they are stated by the standards commitee
1. Don't use global state
2. Don't use goto
3. Don't, for the love of all things good in this world, use exceptions to do control flow
4. Don't just pass strings around in your functions and deserialise them in your function
5. Make your data members private with public accessors and mutators.
- eatitraw 13y ago> In both cases its wrong to mutate the object in the const member, Its just in C++98 no one _explicitly_ told you that. How so? You cannot mutate a data member(without placing mutable before it) in const member function. It is a compiler error. Pretty explicit IMO. The point of the article is that you should ensure thread-safety when you mutate mutable(sounds funny, I know) members in const methods.