title: How std::move applied on function return value?
body: <p>On testing the below code snippet, here i am taking one string vector and trying to return it with <code>std::move(vector)</code>. If i am using member function signature like this  <code>std::vector&lt;std::string&gt;&amp;&amp; getVector()</code> then its working fine. If i am using this <code>std::vector&lt;std::string&gt;&amp; getVector()</code> then its not moving/clearing the vector contents.</p>
  
  <p>Please let me know the correct move semantics to be followed. And please explain difference between both code.</p>
  
  <p>Code :</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  
  class VectorMoveDemo
  {
  public:
      void add(std::string item)
      {
          results_.push_back(item);
      }
      std::vector&lt;std::string&gt;&amp; getVector()
      {
          return std::move(results_);
      }
  private:
      std::vector&lt;std::string&gt; results_;
  };
  
  int main()
  {
      VectorMoveDemo v;
      v.add("Hello ");
  
      std::cout &lt;&lt; "First Time : " &lt;&lt; "\n";
      std::vector&lt;std::string&gt; temp = v.getVector();
      for(auto &amp;item : temp)
      {
          std::cout &lt;&lt; item &lt;&lt; "\n";
      }
      std::cout &lt;&lt; "Second Time : " &lt;&lt; "\n";
  
      v.add("World");
  
      std::vector&lt;std::string&gt; temp2 = v.getVector();
      for(auto &amp;item : temp2)
      {
          std::cout &lt;&lt; item &lt;&lt; "\n";
      }
  }
  </code></pre>
  
  <p><strong>First:</strong></p>
  
  <pre><code>std::vector&lt;std::string&gt;&amp; getVector()
  {
      return std::move(results_);
  }
  </code></pre>
  
  <p><strong>output :</strong></p>
  
  <pre><code>First Time :
  Hello
  Second Time :
  Hello
  World
  </code></pre>
  
  <p><strong>Second</strong></p>
  
  <pre><code>std::vector&lt;std::string&gt;&amp;&amp; getVector()
  {
      return std::move(results_);
  }
  </code></pre>
  
  <p><strong>output :</strong></p>
  
  <pre><code>First Time :
  Hello
  Second Time :
  Hello
  World
  </code></pre>
  
  <p>Any help would be really appreciated.</p>