The following doesn’t compile:



struct A
{
A* partner;


void doodah()
{ ++partner->value; } //this is legal
protected:
int value;
};

struct B: public A
{
void foobar()
{ partner->value += 2; } //but this isn’t
};

The error is that B::foobar() can’t access partner->value, due to protection, even though B is an A. Now I'm not a language lawyer, but honestly this should work. B is an A; and A can access the protected members of other A's. But B can't??