
Hi,
I'm trying to replace few data structures and types defined in my
application in terms of std containers, with the
mutli_index_container. Some of those types look like this:
struct Entry
{
int someForeignKey;
int data1;
std::string data2;
//....
};
typedef std::deque<Entry> Entries;
typedef std::map
Entries;
typedef Entries::index<foreignKey>::type EntriesByForeignKey; Now, I'd like to iterate through the *keys* of this index, and for each key - iterate through all its values. IIUC, the second part can be accomplished like this: { Entries entries; EntriesByForeignKey::iterator begin = entries.get<foreignKey>().find(theKey), end = entries.get<foreignKey>().end(); for_each (begin, end, ....); } ...but how can I iterate through all the keys of this index? Or should I define another index for this purpose (sequenced one?) ? Thank you, Igor'.