[MultiIndex] Key extraction from a base member

19 Oct
2005
19 Oct
'05
8:46 p.m.
Hi. I have the following problem with MultiIndex. For struct Base { int id; }; struct Der : Base { }; I can't make a key extractor. This way typedef multi_index_container< Der, indexed_by< ordered_unique<member<Der, int, &Der::id> >
Set;
doesn't work because &Der::id is of type pointer to member of Base. This other typedef multi_index_container< Der, indexed_by< ordered_unique<member<Base, int, &Base::id> >
Set;
doesn't work because of the ChainedPtr overloads in member. I tried casting &Der::id to the appropiate type, but couldn't make it work. Maybe the solution is to put some enable_ifs in member. Regards, Bruno
7166
Age (days ago)
7166
Last active (days ago)
0 comments
1 participants
participants (1)
-
Bruno MartÃnez