Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1262

Answer by HolyBlackCat for How to safely take all elements from a map?

$
0
0

You unnecessarily wrap std::move, just do Map m2 = std::move(m); directly in main().

As others have noted, it's theoretically possible for m to not be empty after this, so you can follow up with m.clear();.


Viewing all articles
Browse latest Browse all 1262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>