Why can't I inherit a class as mutable? In other words, I'd like all methods of a base-class to be implicitly mutable:
Do any compilers do this? Why isn't it a standard feature?Code:class A { int foo(); } class B: public mutable A { B(){} int bar(); } int main(...) { const B* b = new B(); B->foo(); // Allowed because B inherits a mutable A. }
Can anyone suggest the best work-around?