【发布时间】:2014-10-11 13:45:34
【问题描述】:
我正在尝试为我的 LinkedList 类中的嵌套 Node 类重载
LinkedList<T>::Node& LinkedList<T>::Node::operator<(const LinkedList<T>::Node& rhs){
return rhs;
}
但我只是得到错误
1>c:\users\kevin\workspace\linkedlist\linkedlist.h(185): warning C4183: '<': missing return type; assumed to be a member function returning 'int'
我尝试返回 1,但这也不起作用。
【问题讨论】:
-
在header中,是不是忘记放返回类型了?
-
即使它只是一个代码 sn-p:您正试图将 const Node& 作为 Node& 返回
标签: c++ linked-list operator-overloading nodes