
My head is now exploding with understanding the full power and flexibility of multi-index-container, but still it is not clear to me how best to do the simple things! What is the idiomatically 'correct' way to apply the equivalent functionality of the erase-remove idiom to a multi-index-container? I'm assuming that this, (very much abridged for brevity of exposition) multi_index_container mic; mic.erase( remove_if( mic.begin(), mic.end(), pred ), mic.end() ); is doomed since the remove algorithms overwrite removed elements with copied elements which would cause havoc with other indices, and in any case this kind of modification through iterators is explicitly prohibited. I did think of extracting a vector of references, doing erase-remove on that and then applying rearrange(), but it seems rather inelegant. Is there a better way? Thanks. - Rob.