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
Post a Comment