Boost logo

Boost Users :

From: Jeff Holle (jeffreyholle_at_[hidden])
Date: 2007-09-11 14:52:10


Joaquín Mª López Muñoz wrote:
> The two snippets of code you show are entirely equivalent, in the
> sense that
> Present inherits the functionality of its first index, YIndex. In
> particular
> YIndex::iterator is the *same type* as Present::iterator, so I'm
> puzzled by the
> fact that you're observing different behaviors --from the code you're
> showing,
> using one or the other variation cannot possibly make any difference
> whatsoever.
> Could you please check your code for some other differences you might
> have not noticed when doing the switch from one version to the other?

Thanks for this information.
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?


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