error: class is not a template

11,722

Remove the <T> from the declaration:

template <typename T>
class LinkedList
{
Share:
11,722
Hugo
Author by

Hugo

Updated on June 08, 2022

Comments

  • Hugo
    Hugo almost 2 years

    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?