【发布时间】:2015-01-04 15:33:08
【问题描述】:
您好,如果您能帮助我理解为什么会发生以下错误以及如何解决它,我会很高兴,该错误是二叉树的一部分。
谢谢!!
错误-
错误 C2955 'BSNode':使用类模板需要模板参数列表
部分代码-
template <class T>
BSNode& BSNode::operator=(const BSNode& other)
{
_data = other._data;
_left = 0;
_right = 0;
//deep recursive copy
if (other._left)
{
_left = new BSNode(*other._left);
}
if (other._right)
{
_right = new BSNode(*other._right);
}
return *this;
}
【问题讨论】:
标签: c++ templates compiler-errors binary-tree