I'm using VC 6.0. But when I try to sort a list with comp-function I have problems with compilation of source.
here is my code:
Code: Select all
//comp-function:
bool comp(int a, int b)
{
return (a>b);
}
...
//in main():
list<int> l;
l.push_back(1);
l.push_back(2);
l.push_back(3);
l.sort(comp); // !!! Here I have an error... But why? How can I use this?
But how can I use it with VC 6.0?
Help me, please.