Boost logo

Boost Users :

Subject: [Boost-users] multi_index_container + composite key
From: Uthpal Urubail (uthpal.urubail_at_[hidden])
Date: 2011-11-24 04:08:39


All,

Is it possible create a multi_index_container with keys in non sequenced
order?

i.e, in the below example while extracting the element book entry can I
send the node1 and node2 in different order than how it is created?

      elementbook pb;

      Elem_entry fc1 = Elem_entry(1,90,99);

Extracting:

      elementbook::iterator it;

      it = pb.find(boost::make_tuple(99,90)); ????? Is it possible to
simulate this requirement?

 

typedef multi_index_container<

    Elem_entry,

    indexed_by<

    //non-unique as some might have more than ids

    ordered_unique<

        composite_key<

            Elem_entry,

            member<Elem_entry,unsigned int,&Elem_entry::node1>,

            member<Elem_entry,unsigned int,&Elem_entry::node2>

>

>,

    ordered_unique<

    member<Elem_entry,unsigned int,&Elem_entry::faceid>

>

>

> elementbook;



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