Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2006-03-16 18:15:25


----- Mensaje original -----
De: Jeff Flinn <TriumphSprint2000_at_[hidden]>
Fecha: Jueves, Marzo 16, 2006 11:09 pm
Asunto: Re: [Boost-users] [multi_index] modify_range?

> Joaquín Mª López Muñoz wrote:
>
> So wouldn't the only use of modify_unstable_range be for modifying
> keys and
> indirect members? So only a single modify_unstable_range calling
> .modify_key
> would suffice? Just thinking out loud here, until I have access to
> the docs.

I'm not sure I'm making my point. There are two orthogonal
issues to consider here:

1 Whether you are modyfing whole elements (A) or keys (B).
2 Whether the modification is "stable" (1) or not (2).

The four combinations are actual possibilities:

A1: modify_range
A2: modify_unstable_range
B1: modify_key_range
B2: modify_key_unstable_range

where B1 and B2 (which are not given in my previous
snippet) are written exactly as A1 and A2, respectively,
except that where it read .modify(...) you've got to
write .modify_key(...).

"Stability" is not dependant on whether you're modifying
elements or keys: you can get stable and unstable
range modifications both ways. What defines a stable
range modification of the form
modify[_key]_range(i,first,last,mod) is that,
after modifying an element pointed to by iterator it,
the resulting repositioning does not lie inside [++it,last),
i.e. we're sure we won't visit the element again.
You can see in my previous snippets examples
of stable and unstable range modifications.

>
> Thanks for your library and your help. :)
>
> Jeff

You're welcome, thank you for using the Boost.MultiIndex.

Joaquín M López Muñoz
Telefónica, Inevstigación y Desarrollo


_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


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