title: Error when writing a function that pushes a unique pointer into a vector
body: <p>I have a function that takes in a unique pointer as a parameter and pushes it into a function.</p>
  <pre><code>#include &lt;memory&gt;
  #include &lt;vector&gt;
  
  class SomeObject
  {
  
  };
  
  std::vector&lt;std::unique_ptr&lt;SomeObject&gt;&gt; someObjects;
  
  void PushSomeObject(const std::unique_ptr&lt;SomeObject&gt; pSomeObject)
  {
      someObjects.push_back(pSomeObject);
  }
  
  SomeObject* Create()
  {
      std::unique_ptr&lt;SomeObject&gt; pSomeObject = std::make_unique&lt;SomeObject&gt;();
      PushSomeObject(pSomeObject);
      return someObjects.back().get();
  }
  
  int main()
  {
      SomeObject* pSomeObject = Create();
  }
  </code></pre>
  <p>But I am getting an error</p>
  <pre><code> error: use of deleted function
  </code></pre>
  <p>in line</p>
  <pre><code>PushSomeObject(pSomeObject);
  </code></pre>