Opened 17 years ago

Closed 17 years ago

#551 closed Support Requests (None)

Don't know how to get multiIndex container index shared ptrs

Reported by: nobody Owned by: joaquintides
Milestone: Component: multi_index
Version: None Severity:
Keywords: Cc:

Description

Hello!

My email address is sean@mssengineering.com.

I would like to use const_mem_fun of multiIndex to 
index sharedPtrs.  Maybe there is an easy way to do 
this, but there doesn't seem to be any way obvious to 
me that is really easy.  It would be nice if this was 
a feature of the multiindex container.  Any 
suggestions and/or work arounds that would make this 
possible would be great.

Thank you,
Sean Zlatnik

Change History (2)

comment:1 by joaquintides, 17 years ago

Logged In: YES 
user_id=911241

Hello Sean,

I'm not sure this is what you're looking for, but
you can use const_mem_fun just as if you were
indexing regular objects instead of shared_ptrs
to them, and everything should work fine. This
feature of Boost.MultiIndex key extractors is
explained in detail at:

http://boost.org/libs/multi_index/doc/advanced_topics.html#a
dvanced_key_extractors

Please find attached an example showing how
to use const_mem_fun on a given class element
for indexing shared_ptr<element>s.

Is this what you're after? Thanks for using
Boost.MultiIndex, best regards,

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

comment:2 by joaquintides, 17 years ago

Status: assignedclosed
Note: See TracTickets for help on using tickets.