J
Jakob Bieling
Hi,
Suppose I have a base class and a derived class as follows:
class base
{
public:
void somefunc ();
};
class derived : private base
{
public:
void someotherfunc ();
};
My intend is to prevent the user of 'derived' to access the members of
'base'. The problem is that nothing prevents the user to down-cast the
'derived' class to the 'base' class and then access that member. Is there a
solution to this, other than simply documenting it?
thanks!
Suppose I have a base class and a derived class as follows:
class base
{
public:
void somefunc ();
};
class derived : private base
{
public:
void someotherfunc ();
};
My intend is to prevent the user of 'derived' to access the members of
'base'. The problem is that nothing prevents the user to down-cast the
'derived' class to the 'base' class and then access that member. Is there a
solution to this, other than simply documenting it?
thanks!