
25 Feb
2010
25 Feb
'10
12:11 p.m.
I have the following problem using a multi index container which is uniquely ordered on a pair
. Each time i want to find every pair i that contains a specific integer. The other value of the pair is irrelevant. An example: <0,1> <0,2> <0,3> <1,2> <1,3> <2,3>
and I want to find all the pairs with the value 0 as the first integer.
Make an additional index for the pair::first, then use equal_range() for this index. Or change your existing index to be a composite index with 2 fields (pair::first, pair::second), then you'll be able to use equal_range() specifying the value of pair::first only. http://www.boost.org/doc/libs/1_42_0/libs/multi_index/doc/tutorial/key_extra...