これが私の問題です。
次のような Linked List クラスがあります。
#include <iostream>
#include "List.h"
template <class Elem>
class LList : public List<Elem> { //List is a virtual base class
protected:
Node <Elem> *head;
Node <Elem> *fence;
Node <Elem> *tail;
int leftCount;
int rightCount;
void init();
void removeAll();
public:
LList();
~LList();
//Rest of methods overridden from List class
//////
};
次に、次のように LList から継承する SortedLList というクラスがあります。
#include "LinkedList.h"
#include "Helper.h"
template <class Elem>
class SortedLList : public LList<Elem> {
protected:
Helper *helper;
public:
SortedLList();
~SortedLList();
bool insert(const Elem&); //Override insertion method from LList class
};
SortedLList の実装 (SortledLList.cpp):
#include "SortedLList.h"
template <class Elem>
SortedLList<Elem>::~SortedLList() {
removeAll();
}
template <class Elem>
bool SortedLList<Elem>::insert(const Elem &_e) {
fence = head;
//Rest of Code..
}
宣言されていない識別子 removeAll() の使用というコンパイラ エラーが発生しています。フェンスとヘッド ポインターについても同じことが認識されていません。私は何を間違えましたか?
ありがとうございました。