Boost logo

Boost Users :

Subject: Re: [Boost-users] [multi_index_container] Usage Idioms
From: Daniel Krügler (dsp_at_[hidden])
Date: 2008-09-15 07:35:52


joaquin_at_[hidden] wrote:
> 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;
> }

Btw.: Is this a documented feature that end() will not be invalidated
by erase? Sorry, if this is a beginner's question, but I could not find
such a statement in the docs (probably too blind).

Greetings from Bremen,

Daniel


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