I have a template base class.Lets say.
template
class Base
{
private:
int member1;
char member2;
....
};
I de
Did you try protected? Been a bit since I was deep into C++...
You need to prefix base member names with this-> or Base<KeyF>::, or add a using declaration to the class to unhide them. Their names are dependent names, and they are hidden.
I think two changes needed to solve the issue:
In base class, define the member as "protected" instead of "private" to be accessible in the derived class.
In derived class, add the base class name ahead of the protected member. In this case, it should look like "Base<typename>::member1".
Using C++17 standard in my case, the issue was resolved. Hope this is helpful. Thanks to Kerrek SB for the info.
Members in Base are private. You cannot access private members of class, outside of this class (except friend). Make them protected, or make protected getters.