在VC6下以下操作符会有问题
friend bool operator == (const PRICE& lhs, const PRICE& rhs);
friend bool operator != (const PRICE& lhs, const PRICE& rhs) { return !(lhs == rhs); };
error C2593: 'operator >' is ambiguous
正确的用法是如下
bool operator == (const PRICE& rhs);
bool operator != (const PRICE& rhs) { return !(*this == rhs); };
实际使用是这样的 price pc1, pc2;
pc1 == pc2
同样的, pc1- pc2 也是一个函数看着象确东西似的,其实就这样就可以.