In member function 'data hand<data>::getfingers()':
18:29: error: 'fingers' was not declared in this scope
In instantiation of 'data hand<data>::getfingers() [with data = int]':
23:23: required from here
18:46: warning: no return statement in function returning non-void [-Wreturn-type]
template <typename data> class hand : public human< data > {
public:
hand(int a=50) : human<data>(a) {}
virtual ~hand(){}
// data getfingers() { return fingers+fingers; }
// clarify that fingers is a dependent name
data getfingers() { returnthis->fingers + this->fingers ; }
};
See: 'Why am I getting errors when my template-derived-class uses a member it inherits from its template-base-class?' in https://isocpp.org/wiki/faq/templates