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

Sorry if I got your question wrong, I am storing only pointers to objects inside the map and each instance of myclass would hold one such container to hold pointers to objects of class A along with keys. Yes, but DataMap seems to *replicate* the keys that are already
________________________________
De: boost-users-bounces@lists.boost.org [boost-users-bounces@lists.boost.org] En nombre de Ramesh [rramesh1@gmail.com]
Enviado el: martes, 19 de agosto de 2008 20:16
Para: boost-users@lists.boost.org
Asunto: Re: [Boost-users] Multi-index container (Modifying non-unique key in the container)
On Wed, Aug 13, 2008 at 10:20 AM, JOAQUIN M. LOPEZ MUÑOZ
tDMap;
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

On Wed, Aug 20, 2008 at 8:02 AM, JOAQUIN M. LOPEZ MUÑOZ
------------------------------ *De:* boost-users-bounces@lists.boost.org [ boost-users-bounces@lists.boost.org] En nombre de Ramesh [ rramesh1@gmail.com] *Enviado el:* martes, 19 de agosto de 2008 20:16 *Para:* boost-users@lists.boost.org *Asunto:* Re: [Boost-users] Multi-index container (Modifying non-unique key in the container)
On Wed, Aug 13, 2008 at 10:20 AM, JOAQUIN M. LOPEZ MUÑOZ
wrote: ------------------------------ *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 20:40 [...] Hmm... I'm not referring to your myclass wrapper, but rather to the fact that you're storing DataMaps objects into the container rather than A*s directly.
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
Sorry if I got your question wrong, I am storing only pointers to objects inside the map and each instance of myclass would hold one such container to hold pointers to objects of class A along with keys. Yes, but DataMap seems to *replicate* the keys that are already present in A. Cannot you just have the following?
typedef multi_index_container< A*, indexed_by< ordered_unique< tag <Key1>, BOOST_MULTI_INDEX_MEMBER(A,std::string,Key1)>, ordered_non_unique< tag<Key2>,BOOST_MULTI_INDEX_MEMBER(A,long,Key2)>, ordered_unique< tag<Key3>,BOOST_MULTI_INDEX_MEMBER(A,long,Key3)> >
tDMap;
Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
If I would remove the keys the map would just hold pointers and I wouldnt be able to do lookups based on the keys (to retrieve pointers to objects based on keys) if I wouldnt pair the pointers with they keys in the Map - thats why I have the keys in the map, please correct me if am wrong. Thanks Ramesh
participants (2)
-
JOAQUIN M. LOPEZ MUÑOZ
-
Ramesh