C++ std::set comparator
问题 This is the code: struct comp { bool operator()(Reputation *one, Reputation *two) { if (one->Amount < 0 && two->Amount >= 0) return false; if (one->Amount >= 0 && two->Amount < 0) return true; if (one->Amount >= 0) return one->Amount <= two->Amount; else return one->Amount >= two->Amount; } }; And this is the problem: Debug Assertion Failed! File: ..\VC\include\xtree Line: 638 Expression: invalid operator< After that, I can choose "Abort", "Retry" or "Ignore". If I choose ignore many more