4
내 Node 클래스에있는 친구의 선언으로 인해 클래스가 재정의되고 있다는 이상한 오류가 발생했습니다.이상한 클래스 재정의 오류
이template <class T>
class Node {
private:
T val;
Node<T> * next;
public:
friend class OList;
};
모든 내 다른 클래스 :
template <class T>
class OList { ------> Error here
private:
Node<T> * head;
int size;
public:
OList();
OList(const OList<T> &b);
~OList();
clear();
int size();
T tGet(int input);
int count(T input);
insert (T input);
remove (T input);
uniquify(T input);
Node<T> * returnHead();
};
// Constructs empty list
template <class T>
OList<T>::OList() { ---> Error here
head = NULL;
size = 0;
}
감사합니다. 그렇지만 템플릿이 아닌 클래스의 명시 적 특수화에 대한 오류가 발생합니다. – user48944