title: Why do we copy then move?
body: <p>I saw code somewhere in which someone decided to copy an object and subsequently move it to a data member of a class. This left me in confusion in that I thought the whole point of moving was to avoid copying. Here is the example:</p>
  
  <pre><code>struct S
  {
      S(std::string str) : data(std::move(str))
      {}
  };
  </code></pre>
  
  <p>Here are my questions:</p>
  
  <ul>
  <li>Why aren't we taking an rvalue-reference to <code>str</code>?</li>
  <li>Won't a copy be expensive, especially given something like <code>std::string</code>?</li>
  <li>What would be the reason for the author to decide to make a copy then a move?</li>
  <li>When should I do this myself?</li>
  </ul>