>>21
The foo method makes the bar method private. If you
wanted that then there is nothing wrong with using a get method. But separating that into another class is probably unnecessary in the first place.
Not to mention that examples like this demonstrate nothing. This is a blown up constant integer:
class quz {
public:
quz (int n) : m_number(n) { }
~quz() { }
int bar() { return m_number; }
private:
const int m_number;
};
If you try to win an argument for a language with mocked up code then you suck.