O'Reilly logo
  • LI WEI thinks this is interesting:

get member functions typically only return a copy of the data member being accessed. This means that the original data member's value remains protected and is not modifiable through a get() operation.

From

Cover of Learning C++ by Creating Games with UE4

Note

一个get函数往往返回的不是那个成员变量,而是其副本,这样他就能得到有效保护。