Parag Gadkari ha escrito:
I am having trouble while using multi index container with the "managed c++" component. Here is the typedef that the compiler won't accept.
typedef multi_index_container< gcroot
, indexed_by< ordered_unique< identity
> >, ordered_non_unique , int,&interface_entity::entity_drawingid ,
entity_collection;
The real deal is with the member template which needs the address of member variable of the interface_entity class. Entity class is an abstract Managed type (specified with __gc), and it is not allowed to take the address of a non-static member of a managed type.
Does anybody know of a workaround?
Hello Parag,
A simple solution is to write a custom key extractor as described at:
http://tinyurl.com/l3g6u
In your particular case, the extractor would look like the following
(warning, uncompiled):
struct entity_drawingid_extractor
{
typedef int result_type;
result_type operator()(const gcroot