Class is not a class template

i get the error : class is not a class template .Any idea why?

template<class T>
class nod{ friend class lista<T>;
protected: T info; nod<T> *urm,*prec; };

1 Answer

lista is not known yet at this point in the code. So of course the compiler doesn't think it's a template class. You need to forward declare it with its template arguments. See also: How to forward declare a C++ template class?

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like