If your project is really large & you're retrofitting private member control into it, you may find it helpful to go an alternate route: Don't implement getters at all.... just implement the setters. Define a const public reference to each underlying private member variable, which serves as the "getter" for it. Any code that reads this data can remain unchanged; you only have to update the code that sets these variables, which may be a lot less painful to update. If you go this route, you'll have to initialize these public references in the constructors, like this:
class fred {
public:
fred() : stone(_stone) {} // every constructor must initialize all public references like this
void set_stone(int s) { _stone = s; }
int get_stone() { return _stone; } // Instead of this (or, in ADDITION to this), do this....
const int& stone; // const public reference to internal private data member
private:
int _stone;
}
You can go with that solution permanently, or only until you ("someday") finish updating all of your getters. Personally for classes where the data types of their internal data is pretty obvious & won't change, I prefer this solution anyway, as code written with it is just easier to read. I wish that C++ had an operator classmember_setter<membername>() feature that would allow you to write a setter method that would look just like you were simply accessing a data member instead of calling a method on it; that would result in a whole lot neater code than you get with setter methods.