title: c++11, salvaging a set
body: <p>Is there a clean way of moving the elements of a set out of it ? Something like:</p>
  
  <pre><code>set&lt;A&gt; s {...};
  vector&lt;A&gt; v;
  for (const A&amp; a : s)
      v.push_back(move(const_cast&lt;A&amp;&gt;(a)));
  s.clear(); //undefined behavior?
  </code></pre>