Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

STL ªº sort ¦p¦ó¥¿½Tªº¨Ï¥Î?

0 views
Skip to first unread message

Ps Huang

unread,
May 10, 2002, 7:45:08 AM5/10/02
to

我在 BCB 6 裡面,

自己定義了 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>

0 new messages