I'm trying to sort a list (part of a class) in descending containg items of a struct but it doesn't compile(error: no match for 'operator-' in '__last - __first'
):
sort(Result.poly.begin(), Result.poly.end(), SortDescending());
And here's SortDescending:
struct SortDescending
{
bool operator()(const term& t1, const term& t2)
{
return t2.pow < t1.pow;
}
};
Can anyone tell me what's wrong?
EDIT It works now thanks to Glen and everyone else!
Thanks!