title: Can a std::map be efficiently split into two std::maps at an iterator?
body: <p>Let's say I have a <code>std::map&lt;int, std::string&gt; myMap</code> containing the data</p>
  <pre><code>1. Red
  2. Blue
  3. Green
  5. Fuchsia
  6. Mauve
  9. Gamboge
  10. Vermillion
  </code></pre>
  <p>and also an <code>std::map&lt;int, std::string&gt;::iterator it</code> pointing at the element</p>
  <pre><code>5. Fuchsia
  </code></pre>
  <p>I would like to do something like (making this up)</p>
  <pre><code>std::map&lt;int, std::string&gt; myHead = eject(myMap, myMap.begin(), it);
  </code></pre>
  <p>which would result in <code>myMap</code> containing</p>
  <pre><code>5. Fuchsia
  6. Mauve
  9. Gamboge
  10. Vermillion
  </code></pre>
  <p>and <code>myHead</code> containing</p>
  <pre><code>1. Red
  2. Blue
  3. Green
  </code></pre>
  <p>I could accomplish this by doing something like</p>
  <pre><code>std::map&lt;int, std::string&gt; myHead;
  myHead.insert(myMap.begin(), it);
  myMap.erase(myMap.begin(), it);
  </code></pre>
  <p>but this seems suboptimal in at least some cases, e.g. if I pick a point such that I'm just splitting off a subtree.  (I'll admit that I haven't actually thought through the actual details of the algorithmic complexity here, but if we imagine a case where the value type is extraordinarily expensive to copy then it's clear that the above can't be optimal in general.)</p>
  <p><strong>Question:</strong> is there a way that I can get <code>std::map</code> to perform this operation in an optimal manner, or do I have to write my own binary search tree where I have access to the internals to accomplish this?</p>