|
-
December 3rd, 2005, 12:34 PM
#3
Re: Why won't std::list sort?
1) std::sort requires random access iterators. std::list has
bi-directional iterators.
2) you should use the sort() member function for std::list
3) If you are using vc++6 , the predicated version incorrectly
requires the predicate to be in a special form (I don't recall
the exact form (something about dreived from std::greater).
If possible, define operator < for MyPoint, and use the
non-predicated version of the std::list::sort member function.
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
|