Problem with protected fields in base class in c++
问题 I have a base class, say BassClass , with some fields, which I made them protected, and some pure virtual functions. Then the derived class, say DerivedClass , like class DerivedClass : public BassClass . Shouldn't DerivedClass inherit the protected fields from BassClass? When I tried to compile the DerivedClass, the compiler complains that DerivedClass does NOT have any of those fields, what is wrong here? thanks 回答1: If BassClass (sic) and DerivedClass are templates, and the BassClass