Boost logo

Boost Users :

From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2007-07-04 14:55:47


Hello Tony,

Gottlob Frege <gottlobfrege <at> gmail.com> writes:

>
> On 6/29/07, Felipe Magno de Almeida <felipe.m.almeida <at> gmail.com> wrote:
> >
> > Use equal_range. It returns a pair of iterators to begin and end of
> > the equal range.
> >
>
> Similar question - once I have the equal_range, how do I iterate
> through them via a different index?
>
> ie ordered_non_unique<category...> + ordered_unique<ItemName...>
>
> how do I display a list of the items sorted by category, then by item
> name within each category?

If what you want to do is traverse a range obtained from index
#n following the order imposed by index #m, then you can't do
that efficiently, sorry. However, the particular case you're
posing does not boil down to that, but to something different:
ordering elements by lexicographical order according to two
keys, here category and ItenName. You can do this by making
the category use a composite key on category+itenname.

Not sure whether this is what you're after. Does it help?

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net