There are three classes:
class A
{
friend I_B;
protected:
void* mData;
};
class I_B
{
void foo() = 0;
};
class B_Impl : public I_B
{
B_Impl( A* value )
:
mData( value->mData ) <--- ERROR
{
}
void foo() { mData->DoSomething() };
protected:
void* mData;
};
At compile time I get an error in the constructor, that mData is a protected member.
Please explain me please why it happens.
Can I get access to protected members using "friendship" of the base class?