|
-
September 15th, 2001, 02:11 PM
#1
using STL's list::sort()?
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]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|