title: Reusing a moved container?
body: <p>What is the correct way to reuse a moved container?</p>
  
  <pre><code>std::vector&lt;int&gt; container;
  container.push_back(1);
  auto container2 = std::move(container);
  
  // ver1: Do nothing
  //container2.clear(); // ver2: "Reset"
  container = std::vector&lt;int&gt;() // ver3: Reinitialize
  
  container.push_back(2);
  assert(container.size() == 1 &amp;&amp; container.front() == 2);
  </code></pre>
  
  <p>From what I've read in the C++0x standard draft; ver3 seems to be the correct way, since an object after move is in a </p>
  
  <blockquote>
    <p>"Unless otherwise specified, such moved-from objects shall be placed
    in a valid but unspecified state."</p>
  </blockquote>
  
  <p>I have never found any instance where it is "otherwise specified".</p>
  
  <p>Although I find ver3 a bit roundabout and would have much preferred ver1, though vec3 can allow some additional optimization, but on the other hand can easily lead to mistakes.</p>
  
  <p>Is my assumption correct?</p>