title: How to safely "pop-front" from std::map without extra copy?
body: <p>I have a <code>std::map</code> object.</p>
  <pre><code>std::map&lt;std::string, std::string&gt; m;
  
  m.insert({ &quot;abcd&quot;, &quot;foo&quot; });
  m.insert({ &quot;1234&quot;, &quot;bar&quot; });
  </code></pre>
  <p>and I want to get and remove the first element, like:</p>
  <pre><code>auto iter = m.begin();
  auto [key, value] = std::move(*iter);
  m.erase(iter);
  do_something_with(key, value);
  </code></pre>
  <p>Is this considered safe?
  (Moving from the iterator should make the key an empty string, which makes the <code>m</code> an invalid map.)</p>