how do i use STL's list's sort method (the one that takes a parameter). say for instance, i have code like this:
list<MyClass*> myList;
and i want to sort it. this is what i'm thinking of doing, but don't know if it is correct:
bool LessThan(const MyClass*& lhs, const MyClass*& rhs) {
return (*lhs) < (*rhs);
}
myList.sort(LessThan);
will that work? is that how it is suppose to work? what is the function declaration suppose to look like that you pass to sort()?
thank you very much
-christopher bottaro
[email protected]
