Boost logo

Boost Users :

Subject: Re: [Boost-users] [multi_index] Couple of questions on multi-index containers
From: Joaquín M Lopez Munoz (joaquin_at_[hidden])
Date: 2014-09-29 14:47:32


Ovanes Markarian <om_boost <at> keywallet.com> writes:

> Hello Joaquin,
> I just came up with a slightly different question in more or less
> same direction. Can I safely erase data from the index view in
> a range based for loop. The index container contains only
> ordered indices (no random access).

No: the definition of range-based for given in
[stmt.ranged] actually *guarantees* that you'd produce
undefined behavior (the iterator is post-incremented).

Joaquín M López Muñoz
Telefónica


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