I am confused: I thought protected data was read/writable by the children of a given class in C++.
The below snippet fails to compile in MS Compiler
You just shouldn't copy an A object in a B constructor. The intention is to leave the initialization of A's members to it's own constructor:
A
B
struct A { A( const A& a ): data( a.data ) {} protected: int data; }; struct B : public A { B( const A& a ): A( a ) {} };