Re: [Boost-users] [boost-users][multi-index] iterating though index keys

12 Jun
2008
12 Jun
'08
5:58 p.m.
Hi JoaquĆn,
for(Entries::iterator it_key=entries.begin(),end=entries.end();it_key!=end;){ // get all elements with key it_key->someForeignKey std::pairEntries::iterator,Entries::iterator values= entries.equal_range(it_key->someForeignKey); while(values.first!=values.second){ // process element ++values.first; } // next key is just that of the element right after the current value group it_key=values.second; }
Thank you! It seems to be exactly what I need. However, I'm not sure I got the principle right: how come that "next key is just that of the element right after the current value"? Is this the general behavior of equal_range - despite of the kind of the index (ordered/hashed, unique/non-unique)?
6156
Age (days ago)
6156
Last active (days ago)
0 comments
1 participants
participants (1)
-
Igor R