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
elementbook;
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?
How do you expect MIC to know what 99 is and what 90 is? MIC assumes that the order of tuple elements corresponds to the order of the part in your composite key:
composite_key< Elem_entry, member
, member >
i.e., the 1st one is node1, and the 2dn one is node2.
Thanks, Uthpal -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Igor R Sent: Thursday, November 24, 2011 3:14 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] multi_index_container + composite key How do you expect MIC to know what 99 is and what 90 is? MIC assumes that the order of tuple elements corresponds to the order of the part in your composite key:
composite_key< Elem_entry, member
, member >
i.e., the 1st one is node1, and the 2dn one is node2.
participants (2)
-
Igor R
-
Uthpal Urubail