title: Method returning std::vector<std::unique_ptr<Object>>
body: <p>As a continuation of a: <a href="https://stackoverflow.com/questions/30968477/c-try-finally-how-to-free-memory#30968508">Thread</a>, I came across a problem with
  writing a method of a class which returns: </p>
  
  <pre><code>std::vector&lt;std::unique_ptr&lt;Object&gt;&gt; 
  </code></pre>
  
  <p>I get compiler errors when such a return type is written. There is some problem with delete operand or something ...</p>
  
  <p>Generally, I've wanted to write a method which initializes vector and returns it. </p>
  
  <p>Could anyone help me how to write it?</p>
  
  <h2>EDIT:</h2>
  
  <p>I Get:
  attempting to reference a deleted function  h:\pliki programów (x86)\microsoft visual studio 12.0\vc\include\xmemory0   </p>
  
  <p>Here I have the following code snippet. Can I create such a method like this?</p>
  
  <pre><code>std::vector&lt;std::unique_ptr&lt;Object&gt;&gt; Class::TestMethod(int param)
  {       
      std::vector&lt;std::unique_ptr&lt;Object&gt;&gt; array;
  
      auto day = std::make_unique&lt;Object&gt;();          
      array.push_back(day);
  
      return array;
  }
  </code></pre>