#include using std::cout; using std::endl; class box { public: box() : val(0), typ(0) {} void print() const { cout << "I am a box with val " << val << " and typ " << typ << endl; } mutable int val; int typ; }; int main(int argc, char** argv) { const box bx; bx.print(); bx.val = 2; // wont compile because bx is const // bx.typ = 3; bx.print(); return 0; }