title: Value can be moved even if passed by value
body: <p>In the following program, how is it possible for the move to complete if the parameter was passed by value? </p>
  
  <p>Both constructor signatures; <code>MyContainer(Myclass&amp;&amp; myclass)</code> and <code>MyContainer(Myclass myclass)</code> work equally well, but <code>Myclass</code> only has a move constructor, the rest are deleted. </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  class Myclass {
  public:
      Myclass(int value) : value{value} {std::cout &lt;&lt; "Constructed with value " &lt;&lt; value &lt;&lt; "\n";}
      Myclass(Myclass&amp;&amp; other) : value{other.value}
      {
          other.value = 0;
          std::cout &lt;&lt; "Move constructed with value " &lt;&lt; value &lt;&lt; "\n";
      }
      Myclass(const Myclass&amp; other) = delete;
      Myclass&amp; operator=(const Myclass&amp; other) = delete;
      Myclass&amp; operator=(Myclass&amp;&amp; other) = delete;
      ~Myclass() {std::cout &lt;&lt; "Destructed with value " &lt;&lt; value &lt;&lt; "\n";}
  private:
      int value;
  };
  
  class MyContainer {
  public:
      //MyContainer(Myclass&amp;&amp; myclass) : myclass{std::move(myclass)} { } // Shouldn't this be the constructor definition?
        MyContainer(Myclass   myclass) : myclass{std::move(myclass)} { } // this also works, why?
  private:
      Myclass myclass;
  };
  
  int main()
  {
      Myclass myclass{5};
      MyContainer mycontainer{std::move(myclass)};
  
      return 0;
  }
  </code></pre>
  
  <p>When the constructor is called I do use <code>std::move</code>, but how does the compiler 'remember' that it was moved if the parameter was <code>Myclass</code> and not <code>Myclass&amp;&amp;</code>?</p>