自己定義了 class A,
class A {
public:
//... member
bool operator>(const A &);
bool operator<(const A &);
}
然後有一個 vector 是 vector<A> test;
再呼叫 sort(test.begin(), test.end);
這個時後, Compiler error
[C++ Error] _function_base.h(73): E2093 'operator<' not
implemented in type 'A' for arguments of the same type
可是我有定義 A::operator< 啊!
想不通耶!!!!
--
* Origin: CHU PowerBBS (中華大學方城資訊站) <b...@bbs.chu.edu.tw>