[Solved] The right way to copy map elements
Considering that your map values are maps themselves, copying those inner maps will be quite expensive. It’s probably slightly cheaper to use pointers to the inner maps than to use iterator, but both are significantly cheaper than copying the inner maps. However, whether you use pointers or iterators, make sure that they’re not invalidated. The … Read more