Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2007-09-11 18:01:16


----- Mensaje original -----
De: Jeff Holle <jeffreyholle_at_[hidden]>
Fecha: Martes, Septiembre 11, 2007 8:53 pm
Asunto: Re: [Boost-users] [multi_index] erasing elements
Para: Boost Users mailing list <boost-users_at_[hidden]>

[...]
> The two code snippets were not equivalent because I was only using
> the iterator returned from the multi_index container's erase
> method in the one using YIndex::iterators. I have found that this
> iterator doesn't point to an element in the container. Instead
> its pointing to some memory that is zeroed. Prior to erasing the
> element I inserted some test code that looks though the entire
> container and doesn't find such an element. Given my constructor,
> this only makes sense.
>
> Do you have an explanation?

Banning a bug in B.MI, the only plausible explanation is that
this weird-behaving iterator is index.end(), which is not
dereferenceable. This is the expected return value of
erase() when the element erased is the last one in the index.
Can you verify this hypothesis? Thank you!

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