Re: Sorting a map by value

From: Kevin W. (contact_at_in.sig)
Date: 08/25/04


Date: Wed, 25 Aug 2004 06:20:06 GMT


>> How do I sort a map by the value, rather than the key?
>
> You can't sort maps. They are always automatically sorted by key.

Yes, but I should be able to define the "less than" predicate in the
constructor, or I should be able to pass a custom predicate into the sort
function (as I understand it, you *can* sort a map because it is only
automatically sorted when pairs are added or removed).

What I'm really asking is:
What are the arguments to this functor (values, pointers or references),
and
How do I access the value from these arguments?

-- 
Kevin W :-)
Opera/CSS/webdev blog: http://www.exclipy.com/
Using Opera: http://www.opera.com/m2/


Relevant Pages

  • OT: Birthday, London, Friday
    ... You can see how the two discoveries were sort of simultaneous. ... underground map, and one of the allegedly realist ones it replaced; ... was the motto of Michelin and is the nickname of the ... The building has three large stained glass panels depicting ...
    (rec.arts.mystery)
  • Re: i got trapped in Wales because
    ... I've never caught her holding the map upside ... To be honest, I've never actually used a 'carbide lamp', but the ones ... meant for vehicles that I've seen lacked any sort of 'lighter' of their ... Paraffin lamps almost always need a match or something. ...
    (uk.people.support.depression)
  • Re: Spoilered for talk of religion
    ... Beats following someone else's map if you ask me - if you do that, ... around me', get on with things, complete a task, that sort of thing. ... That sort of gamble is a `near 100% gamble' as far ...
    (uk.people.support.depression)
  • Re: Finding, sharing and starting jam sessions
    ... offer which sort of music, let alone whether I can join in or not. ... Additionally, each post lists ... folkjam.org with a private map and forum. ... the domestic jams on the site in anything less than a year. ...
    (rec.music.folk)
  • Re: Copy contents of map into vector
    ... >> If you put them into a vector, then sort them, you will pay a lot ... > I don't need the map because the position in the vector determines the id ... to make a tradeoff between different measures of goodness. ... Your "elegance" has the same attribute. ...
    (microsoft.public.vc.language)