看看这段代码为什么报错啊?
这是申明部分:template<typenameT>classCBTreeNode{Telement;CBTreeNode*left;CBTreeNode*right;}...
这是申明部分:
template <typename T>
class CBTreeNode
{
T element;
CBTreeNode * left;
CBTreeNode * right;
};
template <typename T>
class CBTree
{
public:
typedef std::list<T> TraverseList ;
CBTree(std::istream & istream_handler);//通过输入流建立
void create(CBTreeNode<T>* root,std::istream & istream_handler);
~CBTree();
void destory(CBTreeNode<T>* root);
std::size_t size();
std::size_t getTreeSize(CBTreeNode<T>* root);
std::size_t height();
std::size_t getTreeHeight(CBTreeNode<T>* root);
bool isEmpty();
TraverseList preOrder();
TraverseList midOrder();
TraverseList postOrder();
protected:
CBTreeNode<T> * root;
};
以下是函数实现部分:
template<typename T>
typename CBTree<T>::TraverseList CBTree<T>::preOrder(){
}
提示Member declaration not found我用的eclipse,怎么回事啊? 展开
template <typename T>
class CBTreeNode
{
T element;
CBTreeNode * left;
CBTreeNode * right;
};
template <typename T>
class CBTree
{
public:
typedef std::list<T> TraverseList ;
CBTree(std::istream & istream_handler);//通过输入流建立
void create(CBTreeNode<T>* root,std::istream & istream_handler);
~CBTree();
void destory(CBTreeNode<T>* root);
std::size_t size();
std::size_t getTreeSize(CBTreeNode<T>* root);
std::size_t height();
std::size_t getTreeHeight(CBTreeNode<T>* root);
bool isEmpty();
TraverseList preOrder();
TraverseList midOrder();
TraverseList postOrder();
protected:
CBTreeNode<T> * root;
};
以下是函数实现部分:
template<typename T>
typename CBTree<T>::TraverseList CBTree<T>::preOrder(){
}
提示Member declaration not found我用的eclipse,怎么回事啊? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询