Idiomatic Way to declare C++ Immutable Classes
The way you proposed is perfectly fine, except if in your code you need to make assignment of RockSolid variables, like this: RockSolid a(0,1); RockSolid b(0,1); a = b; This would not work as the copy assignment operator would have been deleted by the compiler. So an alternative is to rewrite your struct as a … Read more