为何编译器提示 Class×× is not a template type
template <class T>
class BinaryTree {
public:
BinaryTree() : root(NULL) {
}
BinaryTree(const T& value) {
root->data = value;
}
BinaryTree(const BiTNode<T> *& rootNode) {
root = rootNode;
}
BiTNode<T> * getRoot() {
return root;
}
void setRoot(const T data) {
root->data = data;
}
void Traverse(BiTNode<T> *subTree,ostream& out);
void setRoot(const T data, const BiTNode<T> *l = NULL, const BiTNode<T> *r = NULL) {
root->data = data;
root->lchild = l;
root->rchild = r;
}
void Depth(const BiTNode<T>* &tr, int h, int &depth);
void CreateBiTree(BiTNode<T> *& Tree, vector<T> &vchar, T NullTag);
/**
* 复制构造函数
* @param s
*/
BinaryTree(const BinaryTree<T> &s);
~BinaryTree() {
destroy(root);
}
private:
protected:
T refValue;
BiTNode<T> *root;
void destroy(BiTNode<T> *&subT);
BiTNode<T> *getParent(const BiTNode<T> subTree, const BiTNode<T>*& e);
};