title: How to give a default value to a member unique_ptr in constructor?
body: <p>For example, I have a class</p>
  
  <pre><code>class A
  {
  public:
      // argument with default value is too long, any better way
      A(std::unique_ptr&lt;int&gt; data = std::unique_ptr&lt;int&gt;(new int(10))) 
          : mData(std::move(data))
      {}
  
      // Is r-value better? Is the following code okay?
      A(std::unique_ptr&lt;int&gt;&amp;&amp; data = std::unique_ptr&lt;int&gt;(new int(10)))
          : mData(data)
      {}
  
  private:
      std::unique_ptr&lt;int&gt; mData;
  };
  </code></pre>