请教关于重载的函数在与STL算法匹配时的问题
在做编译器作业时,我为符号表写了一个类,重载了函数<
class Symbol
{
......
bool operator< (Symbol& str){
return this->s.first < str.symValue();//这两个操作数都是string型的
}
在我调用lower_bound()算法时出现了问题
i = lower_bound(table.begin(), table.end(), s);
[C++ Error] _function_base.h(73): E2093 'operator<' not implemented in type 'Symbol' for arguments of the same type
我明明已经重载了操作符operator<,为什么出现这种提示呢?
其中table的类型为vector<Symbol>,s的类型为Symbol