   Template error
  I`ve read "Modern C++ Design" and tried to implement typelists...I just want to know what's wrong with this code... class Nulo {};template<typename U,typename L>struct TypeList{typedef U Cabeca;typedef L Calda;};template<typename Lista>struct Comprimento{enum {Result=1+Comprimento<Lista::Calda>::Result};};template<>struct Comprimento<Nulo>{enum {Result=0};};template<class TList, unsigned int indice>struct TipoIndice;template<class U, class L>struct TipoIndice<TypeList<U,L>,0>{typedef T Tipo;};template<class U, class L, unsigned int indice>struct TipoIndice<TypeList<U,L>,indice>{typedef TipoIndice<T, indice-1>::Tipo Tipo;};It generates these compile errors:c:\Daniel\TypeList.h(27): error C2065: 'U' : undeclared identifierc:\Daniel\TypeList.h(27): error C2065: 'L' : undeclared identifierc:\Daniel\TypeList.h(27): error C2687: cannot define a nested UDT of a template class out of linec:\Daniel\TypeList.h(27): fatal error C1903: unable to recover from previous error(s); stopping compilationI am using VC++ .net.Thanks[edited by - danielf on February 14, 2004 1:57:42 AM]
  IIRC, much of the code in "Modern C++ Design" won''t compile under MSVC .NET. You can go to the Loki Sourceforge project''s webpage to download versions of the code ported to your compiler. 