23 Nov
2011
23 Nov
'11
1:19 p.m.
2011/11/23 Claude <clros@tiscali.it>:
I used this definition:
typedef multi_index_container< int, indexed_by<sequenced<> >
mySet;
But this not preserve the insertion order. I think that my error is in "index_by<>"; it is true? How do I fix?
First of all: do you need key-value container (map/hash map) or just sequential one (list/vector)? If you need it to be both at the same time, multi-index is the way to go then and you need need 2 indices, ordered and sequenced, for example: typedef multi_index_container< std::string, indexed_by< sequenced<>, ordered_unique<identity<std::string> >
text_container;
Cheers, Simon -- Szymon Gatner The Lordz Games Studio www.thelordzgamesstudio.com