作者autumn31 (路边小草)
看板EE_DSnP
标题[问题] BST compile
时间Fri Dec 9 01:25:54 2011
make b 之後出现了这行
../../include/bst.h:81:7: error: passing ‘const BSTree<AdtTestObj>’ as ‘
this’ argument of ‘BSTreeNode<T>* BSTree<T>::findmin(BSTreeNode<T>*) [with
T = AdtTestObj]’ discards qualifiers
不太清楚compiler这行的意思是什麽
底下是我的code
BSTree:{
public:
iterator begin() const
{
iterator it;
it._node = findmin(_root);
return it;
}
private:
BSTreeNode<T>* findmin(BSTreeNode<T>* t)
{
if(t->_Lchild == 0)
return t;
else
return findmin(t->_Lchild);
}
BSTreeNode<T>* _root;
我看来看去还是看不出错在哪里QQ阿阿阿阿阿阿~~~
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.224.47.6
※ 编辑: autumn31 来自: 61.224.47.6 (12/09 01:29)
1F:推 ric2k1:BSTreeNode<T>* findmin(const BSTreeNode<T>* t) {...} 12/09 01:34
2F:→ djshen:const function可以使用非const function? 12/09 01:51
3F:→ autumn31:欧欧!!!!谢谢大钧和老师~~~~ 12/09 01:58