title: Why isn't object returned by std::move destroyed immediately
body: <p>I tested the following code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  class foo{
  public:
      foo()       {cout&lt;&lt;"foo()"&lt;&lt;endl;}
      ~foo()      {cout&lt;&lt;"~foo()"&lt;&lt;endl;}
  };
  
  int main()
  {
      foo f;
      move(f);
      cout&lt;&lt;"statement \"move(f);\" done."&lt;&lt;endl;
      return 0;
  }
  </code></pre>
  
  <p>The output was:</p>
  
  <pre><code>foo()
  statement "move(f);" done.
  ~foo()
  </code></pre>
  
  <p><strong>However, I expected</strong>:</p>
  
  <pre><code>foo()
  ~foo()
  statement "move(f);" done.
  </code></pre>
  
  <p>According to the source code of the function move:</p>
  
  <pre><code>  template&lt;typename _Tp&gt;
      constexpr typename std::remove_reference&lt;_Tp&gt;::type&amp;&amp;
      move(_Tp&amp;&amp; __t) noexcept
      { return static_cast&lt;typename std::remove_reference&lt;_Tp&gt;::type&amp;&amp;&gt;(__t); }
  </code></pre>
  
  <p>The returned object is a right value, So Why isn't it destroyed immediately?</p>
  
  <p><br>
  <br>
  -----------------------------------------------------------------<br>
  I think I just confused rvalue and rvalue reference. <br>
  I modified my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  template&lt;typename _Tp&gt;
  constexpr typename /**/std::remove_reference&lt;_Tp&gt;::type /* no &amp;&amp; */
  /**/ mymove /**/ (_Tp&amp;&amp; __t) noexcept
  { return static_cast&lt;typename std::remove_reference&lt;_Tp&gt;::type&amp;&amp;&gt;(__t); }
  
  using namespace std;
  class foo{
  public:
      foo()       {cout&lt;&lt;"foo() at "&lt;&lt;this&lt;&lt;endl;} /* use address to trace different objects */
      ~foo()      {cout&lt;&lt;"~foo() at "&lt;&lt;this&lt;&lt;endl;} /* use address to trace different objects */
  };
  
  int main()
  {
      foo f;
      mymove(f);
      cout&lt;&lt;"statement \"mymove(f);\" done."&lt;&lt;endl;
      return 0;
  }
  </code></pre>
  
  <p>And now I get what I've been expecting:</p>
  
  <pre><code>foo() at 0x22fefe
  ~foo() at 0x22feff
  statement "mymove(f);" done.
  ~foo() at 0x22fefe
  </code></pre>