I used to use map to access elements. map has a good feature that it sort the element automatically. Now I need a map which can access element through multiple key values. So I choosed boost::multi_index_container. I defined a container as follows.
What I am wondering is whether boost::multi_index_container can sort elements automatically. Specifically, are all elements extracted through iterator from begin to end shown below having b values between 2 and 100?
1 2 3
test t;
test::iterator begin = t.lower_bound(make_tuple(1,2));
test::iterator end = t.upper_bound(make_tuple(1,100));
thanks for reply. but my question is about the sequence of the composite key. I know that the the elements are sorted according to the values of their keys. But how are the elements with composite key being sorted? Are the elements sorted according to the first key, then the elements with the same value of the first key are sorted according to the second one?