c++ - Swapping each pair of values in a multimap<int, int> -


i have multimap containing on 5 million pairs , need swap keys values.

unordered_multimap<int, int> edge; 

due large size of container , processes involved, prefer not have create new multimap swapped pairs iterating on each element of map.

what best way, if any, in place?

the proper approach not @ all, instead have bi-directional map in first place, on can perform lookup in either direction.

consider looking boost.bimap.


Comments

Popular posts from this blog

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

C# random value from dictionary and tuple -

algorithm - Testing tetrahedron-triangle intersection -