Chainage ch; // Here I use the type i've defined up there
And the template will define all the methods. But I have the following compilation problem :
"alist.hpp:16:9: erreur: expected unqualified-id before ‘template’
alist.hpp:20:4: erreur: ‘Maillon’ does not name a type
alist.hpp:23:2: erreur: ‘Maillon’ does not name a type
alist.hpp:24:2: erreur: ‘Maillon’ does not name a type"
template <class K, class V>
struct _maillon *succ;
typedef _maillon<int, int> Maillon;
the code i posted above compiles just fine and should suite your needs.
You cant typedef a template struct when defining the template struct from what ive been told. you define the struct then typedef once the struct has been defined.
also i used ints as the types but that could be changes as needed. thats one of the things you were missing.