
Hi, I stumbled upon this multi-index example: http://www.boost.org/doc/libs/1_46_1/libs/multi_index/doc/examples.html#exam... and I do not understand the gains in the second step. To sum up, the example wants to apply two predicates to the search - select elements with the given manufacturer, and select elements that fall in a certain price range. It does so by using one predicate in a first search (for example, finding all elements with the given manufacturer), then taking the range of search results, and copy it to another multi-index container (using pointers to avoid unnecessary deep copying of the elements). Then it performs a second search using the other predicate (in this example, the price range) to further narrow down the range of results. It is this copying and creating of the 2nd container that bugs me. Isn't this unnecessary? It implies O(n) steps to insert the search results, n being the number of results from the 1st search. Then, why use a second multi-index container? Why shouldn't I just use remove_copy_if() instead? it would make sense if copying the subset into a new multi-index container were faster than O(n), but I doubt that. What do you think? regards