title: How to store a vector of objects of an abstract class which are given by std::unique_ptr?
body: <p>I got a loop in which i use a function returning std::unique_ptr to an object of an abstract class. I want to store these objects into a std::vector via push_back. But since the objects are of abstract type i get the following error:</p>
  
  <pre><code>error: cannot allocate an object of abstract type
  </code></pre>
  
  <p>for the line</p>
  
  <pre><code>  cells.push_back(std::move(*cell));
  </code></pre>
  
  <p>where cells is a <code>std::vector</code> of the abstract type and <code>cell</code> is of type</p>
  
  <pre><code>std::unique_ptr&lt;AbstractType&gt;&amp;&amp; cell
  </code></pre>
  
  <p>(I actually pass <code>cell</code> to a handler class)
  I know that one can not instantiate an abstract type and as I'm understanding the std:move operator it need to instantiate the object somehow?</p>
  
  <p>Can anybody help me how to manage the problem? Or should the function (not my part of the project) not return a unique pointer to an object of an abstract type? </p>