I have a constructor attempting to initialize a field in a base class. The compiler complains. The field is protected, so derived classes should have access.
You cannot initialize m_data in the derived class constructor but instead pass it as an argument to the base class constructor.
That is: DerivedClass::DerivedClass(std::string data) : BaseClass(data) { }
DerivedClass::DerivedClass(std::string data) : BaseClass(data) { }