-
September 15th, 2001, 02:10 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
cjb@cs.utexas.edu
-
September 16th, 2001, 09:19 AM
#2
Re: using STL's list::sort()
http://groups.yahoo.com/group/cpptips/message/259
Please - rate answer if it helped you
It gives me inspiration when I see myself in the top list =)
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor@soukhov.com | ICQ:57404554 | http://soukhov.com
Member of Russian Software Developer Network http://rsdn.ru
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
|