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: 638Expression: invalid operator<
After that, I can choose "Abort", "Retry" or "Ignore". If I choose ignore many more (identical ones) come up but it ends up working perfectly.
The problem seems to occur when I insert a Reputation with ->Amount == to one of the Reputation *'s previously inserted, but I'm not sure about this last one.
Any help would be greatly appreciated
EDIT: The order I want them ordered in is first the positive ones in asc order, then the negative ones in desc order. Example: 1 5 10 11 11 20 50 -1 -5 -50