Re: [Boost-users] Multi-index container (Modifying non-unique key in the container)

Hi Ramesh, ________________________________ De: boost-users-bounces@lists.boost.org [boost-users-bounces@lists.boost.org] En nombre de Ramesh [rramesh1@gmail.com] Enviado el: martes, 12 de agosto de 2008 7:40 Para: boost-users@lists.boost.org Asunto: [Boost-users] Multi-index container (Modifying non-unique key in the container)
You have two options: 1. Use modify(), which is passed the entire element rather than the key, and modify key2 at your pleasure. 2. Project the key1-iterator to a key2-iterator using the projection facilities: http://www.boost.org/libs/multi_index/doc/tutorial/basics.html#projection and then use modify_key() with the key2-iterator. BTW, I've noticed that you're wrapping the A objects into a DataMap class that, oddily enough, replicates the key1, key2 and key3 members. Why aren't you using A members directly thus disposing of the DataMap wrapper? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

Thanks Joaquín, Will try modify & the reasons I am wrapping the map class with a another one is to make sure that the users of the class just get access to APIs and not to the container as such & and also each key is used by a different classes to do lookups. Hence two unique keys. Thanks for your response. Regards Ramesh On Tue, Aug 12, 2008 at 11:31 AM, JOAQUIN M. LOPEZ MUÑOZ <joaquin@tid.es>wrote:
participants (2)
-
JOAQUIN M. LOPEZ MUÑOZ
-
Ramesh