I've always wondered is there a way to have a class member without using getters that can only be modified by it's class?
What I'm thinking of is something like this.
class A
{
public:
crazyconst int x;
void doStuff()
{
// Gettin' stuff done
x = someValue; // OK
}
};
int main(int argc, char** argv)
{
A a;
a.x = 4; // ERROR
}
So it's visible, but read-only for everyone beside its class.