“Forward-unbreakable” accessor class templates [C++]
问题 Unless I am thoroughly mistaken, the getter/setter pattern is a common pattern used for two things: To make a private variable so that it can be used, but never modified, by only providing a getVariable method (or, more rarely, only modifiable, by only providing a setVariable method). To make sure that, in the future, if you happen to have a problem to which a good solution would be simply to treat the variable before it goes in and/or out of the class, you can treat the variable by using an