
23 Nov
2011
23 Nov
'11
7:35 p.m.
but if I would simulate a std::map I should add another field in structure, to store the "value" of the map .. is correct?
Yes, you can add a "key" field to the struct, and then define ordered unique index on it. Note that when accessing multi_index_container you say explicitly which index you're working with. So, when you're working with random_access<> index, you'll get the items in the order of insertion, but when you switch to another (eg. ordered) index, you get the items in another order.