Pergunta

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?

Foi útil?

Solução

Remove the <T> from the declaration:

template <typename T>
class LinkedList
{
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top