I am learning about creating a linked list in my class and I have run into a problem. My linked list is not a template and I can't figure out how to fix it. I looked at some of my notes for the class and the code looks to be the same as the slides but I was wondering if someone would be able to explain what I am doing wrong. Thank you so much.
LinkedList.h
#ifdef LINKED_LIST_
#define LINKED_LIST_
#include "ListInterface.h"
#include "Node.h"
template<class ItemType>
class LinkedList : public ListInterface<ItemType>
{
private:
Node<ItemType>* headPtr;
int itemCount;
Node<ItemType>* getNodeAt (int postion) const;
public:
LinkedList();
LinkedList(const LinkedList<ItemType>& aList);
virtual ~LinkedList();
bool isEmpty() const;
int getLength() const;
bool remove(int postion);
void clear();
ItemType getEntry(int position) const;
ItemType replace(int position, const ItemType& newEntry);
};
#include "LinkedList.cpp"
#endif
LinkedList.cpp
#include "LinkedList.h"
#include <iostream>
using namespace std;
template<class ItemType>
LinkedList<ItemType>::LinkedList() : headPtr(nullptr), itemCount(0){
}
template<class ItemType>
LinkedList<ItemType>::~LinkedList(){
}
The error only says: LinkedList is not a template.