title: C++ vector::clear
body: <pre><code>vector &lt;weight&gt; decoy;
  
  void clear_decoy() {  
  
      decoy.clear();   
  
      vector&lt;weight&gt; (decoy).swap(decoy);  
  }
  </code></pre>
  
  <p>In the above method <code>clear_decoy()</code>, what does <code>vector&lt;weight> (decoy).swap(decoy); </code> mean please? </p>
  
  <p>Does the method clear <code>decoy</code> or not? Thanks!</p>