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:
Failed to run debug check!
File: .. \ VC \ include \ xtree
Line: 638
Expression: invalid operator <
After that I can choose "Abort", "Retry" or "Ignore". If I choose to ignore many others (identical), they will appear, but it works fine.
The problem occurs when I insert Reputation with β Amount == in one of the previously added Reputations *, but I'm not sure about the latter.
Any help would be greatly appreciated.
EDIT: the order I want them to be ordered is first positive in ascending order, and then negative in desc order. Example: 1 5 10 11 11 20 50 -1 -5 -50
Andreas Bonini
source share