3

I have the following class:

#include "SingleNode.h"

template <typename T>
class LinkedList<T>
{
    private:
        SingleNode<T>* head;
        SingleNode<T>* tail;
        SingleNode<T>* current;
        int currentSize;

    public:
        LinkedList();
        ~LinkedList();
};

As far as I can tell there isn't anything wrong with it. However, the compiler is giving me the following:

error: 'LinkedList' is not a template

Why isn't the compiler recognizing it as a template?

Hugo
  • 2,186
  • 8
  • 28
  • 44

1 Answers1

13

Remove the <T> from the declaration:

template <typename T>
class LinkedList
{
Adam
  • 16,808
  • 7
  • 52
  • 98