glebspy
asked on
mutable base class
In the case of multiple inheritance
class A{
...
};
class B{
...
};
class C:
public A,
public B{
int func()const;
};
I wish func to be able to change data members derived via class A but not those derived via class B.
I would like to say
class C:
mutable public A,
public B{
but this is illegal.
What is the best solution which achieves what I want?
class A{
...
};
class B{
...
};
class C:
public A,
public B{
int func()const;
};
I wish func to be able to change data members derived via class A but not those derived via class B.
I would like to say
class C:
mutable public A,
public B{
but this is illegal.
What is the best solution which achieves what I want?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.