Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>No. In a boost multi_index_container, the indices are coupled together as separate views of the same values. This is an important guarantee of boost multi_index_containers.</p> <blockquote> <p>"Boost.MultiIndex allows for the specification of multi_index_containers comprised of one or more indices with different interfaces to the same collection of elements" (<a href="http://www.boost.org/doc/libs/1_53_0/libs/multi_index/doc/tutorial/index.html" rel="nofollow">boost multi_index tutorial</a>).</p> </blockquote> <p>With two distinct sequenced&lt;> indices you can re-arrange the <em>order</em> in two different ways, but they must both contain all values.</p> <p>If you wish to view a subset of elements according to a boolean predicate (eg: value is odd), consider using <a href="http://www.boost.org/doc/libs/1_53_0/libs/iterator/doc/filter_iterator.html" rel="nofollow">boost::filter_iterator</a>. This does not attempt to <em>erase</em> values in the container but instead <em>skip</em> them during iteration.</p> <p>Alternatively, selection/filtering can be obtained by ordering, using a multi_index <a href="http://www.boost.org/doc/libs/1_53_0/libs/multi_index/doc/reference/ord_indices.html" rel="nofollow">ordered_non_unique</a> index with an appropriate <a href="http://www.boost.org/doc/libs/1_53_0/libs/multi_index/doc/tutorial/key_extraction.html" rel="nofollow">key extractor</a>. </p> <p>For example, an ordered_non_unique index based on a <a href="http://www.boost.org/doc/libs/1_53_0/libs/multi_index/doc/tutorial/key_extraction.html" rel="nofollow">key extractor</a>: <code>[](int i) { return i % 2; }</code> will place the odd and even values in distinct groups, so an iterator range to all odd values can be obtained using <a href="http://www.boost.org/doc/libs/1_53_0/libs/multi_index/doc/reference/ord_indices.html" rel="nofollow">equal_range</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload