invalid use of template-name 'Circular' without an argument list
这个报错怎么解决
template<class T>
class ChainNode;
template<class T>
class Circular {
public:
Circular() {last = 0;}
~Circular();
//Circular<T>& Create_LinkList_Head(int n);
int Length() const;
bool Find(int k, T& x) const;
int Search(const T& x) const;
Circular<T>& Delete(int k, T& x);
Circular<T>& Insert(int k, const T& x);
//void Output(ostream& out) const;
private:
ChainNode<T> *last; // pointer to last node
};
template<class T>
class ChainNode{
friend Circular<T>;
private:
T data;//编号 密码通过数组存储
ChainNode<T> *link;
};
template<class T>
Circular<T>::~Circular(){// 链表的析构函数,用于删除链表中的所有节点
if (!last) return; // list is empty
ChainNode<T> *current = last->link, *next;
while (current != last) {
next = current->link;
delete current;
current = next;
}
delete last;
};
Circular<int>& Create_LinkList_Head(int n){// 初始单向循环链表化链表——头插法
Circular<int>* head, *node, *end;
head = new Circular;//这一行报错
head->next = head;
end = head;
for (int i= 0;i<=n;i++){
node = new Circular;
node->data = i+1;
end->next = node;
end = node;
cin >> i+1;
}
end->next = head;
return head;
};