和继承有关的一个编译错误
template <class T>
class LinkedList {
……
};
…………
template<class T>
class EnhancedLinkedlist:public LinkedList<T>{
public:
……
EnhancedLinkedList find_all(const T& key);
};
…………
编译是会报错error C2146: syntax error : missing ';' before identifier 'find_all'
see reference to class template instantiation 'EnhancedLinkedlist<T>' being compiled
error C2501: 'EnhancedLinkedList' : missing storage-class or type specifiers
see reference to class template instantiation 'EnhancedLinkedlist<T>' being compiled
大致就是不能识别EnhancedLinkedList这个类型,怎么解决呢?