Boost logo

Boost Users :

Subject: Re: [Boost-users] Sort boost composite container
From: John M. Dlugosz (ngnr63q02_at_[hidden])
Date: 2014-01-21 10:13:47


On 1/20/2014 4:58 AM, Uthpal Urubail wrote:
> I am having below composite container. I am looking to sort the container by
> member<CA,std::string,&CA::card> at the end.
> Can some one help me to achieve this?
>

If you are just using your existing index for looking up matching values, and don't care
that they are sorted by CA::name, then you can just change the order of your subkeys and
put CA::card first.

> typedef multi_index_container<
> CA,
> indexed_by<
> ordered_unique<
> composite_key<
> CA,
> member<CA,std::string,&CA::name>,
> member<CA,std::string,&CA::displayName>,
> member<CA,std::string,&CA::card>
> >
> >
> >
> > duplicateBook;
>


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