Boost logo

Boost Users :

Subject: Re: [Boost-users] [multi_index_container] Usage Idioms
From: joaquin_at_[hidden]
Date: 2008-09-15 07:07:11


Robert Jones escribió:
> 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?
> [...]
>

Cannot you just resort to a manual for-loop like this?

  multi_t mic;
  ...
  for(multi_t::iterator it=mic.begin(),it_end=mic.end();it!=it_end;){
    if(pred(*it))it=mic.erase(it);
    else ++it;
  }

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net