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.