14

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;
        };
George Marin
  • 389
  • 1
  • 5
  • 11

1 Answers1

15

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?

Community
  • 1
  • 1
tenfour
  • 35,101
  • 13
  • 77
  • 137