Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2007-10-02 17:30:58


----- Mensaje original -----
De: Jeffrey Holle <jeffreyholle_at_[hidden]>
Fecha: Martes, Octubre 2, 2007 11:08 pm
Asunto: Re: [Boost-users] [multi_key] problems using modify_key with a
composite_key index
Para: Boost Users mailing list <boost-users_at_[hidden]>

> While my swap method is now working correctly, I have found the
> the use of modify on a composite_key in order to preform a swap
> has corrupted the index.
>
> The very next time I attempt to use it in a statement like this:
>
> for (tie(iter,iter_end)=xyIndex.equal_range(make_tuple(i));
> iter!=iter_end;++iter)
>
> The for loop runs forever.
> I also attempted to print the distance(iter,iter_end) and this
> function never returns.
>
> Note that it happens that the one time my sort function executed,
> only a single swap was preformed.
>
> Is there a way to fix this?

I lack the context to give a more informed opinion, so the following
is mere speculation: take into account that in a expression of
the form

  c.modify(it,f);

f is *not* allowed to modify any other element of c except *it.
Maybe you are violating this rule in some of your calls to modify()?

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