title: How do I invoke the move constructor?
body: <p>In the code show below, how do I assign rvalue to an object A in function main?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  class A
  {
      public:
          int* x;
          A(int arg) : x(new int(arg)) { cout &lt;&lt; "ctor" &lt;&lt; endl;}
          A(const A&amp; RVal) { 
              x = new int(*RVal.x);
              cout &lt;&lt; "copy ctor" &lt;&lt; endl;
          }
          A(A&amp;&amp; RVal) { 
              this-&gt;x = new int(*RVal.x);
              cout &lt;&lt; "move ctor" &lt;&lt; endl;
          }
          ~A()
          {
              delete x;
          }
  };
  
  int main()
  {
      A a(8);
      A b = a;
      A&amp;&amp; c = A(4); // it does not call move ctor? why?
      cin.ignore();
      return 0;
  }
  </code></pre>
  
  <p>Thanks.</p>