If the classes below were not templates I could simply have x in the derived class. However, with the code below, I have to use this
x
derived
this
The x is hidden during the inheritance. You can unhide via:
template class derived : public base { public: using base::x; // added "using" statement int f() { return x; } };