working with templates

I'm doing some exersize using templates, I try to define class link and class linkedlist, when I try to use it for classes of Book, Books I get error:
"use of class template requires template argument list", It fail to intiate the linkedlist with <Book>. see below:

template <typename T>
class link{
public:

T data;
link * next;
};

template <typename T>
class linkedlist{

public:
link * head;
};

class Book{
public:

private:
string name;
};

class Books{

public:
linkedlist<Book> books;
};

Why does it fail? I don't want to specify in link what I'm going to use.
You need to write
1
2
3
4
5
6
template <typename T>
class linkedlist{

public:
link<T> * head; // Note: link requires a template parameter
};
Thank you!!
Topic archived. No new replies allowed.