title: Error C2280: attempting to reference a deleted function (unique_ptr)
body: <p>I went through some old code that used raw pointers and changed them to <code>unique_ptr</code>s instead. Now, when I try to compile the code, I get this error message:</p>
  
  <blockquote>
    <p>Error  1   error C2280: 'std::unique_ptr>::unique_ptr(const std::unique_ptr&lt;_Ty,std::default_delete&lt;_Ty>> &amp;)' : attempting to reference a deleted function  d:\visual studio 2013\vc\include\xmemory0</p>
  </blockquote>
  
  <p>The compiler output about the situation is huge - to save space in this question, see it <a href="http://pastebin.com/J4xJi3Uy" rel="noreferrer">here</a>.</p>
  
  <p>As far as I can tell, it has something to do with the way I use the unique pointers. It starts from here (level.h, lines 65-66):</p>
  
  <pre><code>typedef std::unique_ptr&lt;Enemy&gt; PEnemy;
  std::list&lt;PEnemy&gt; m_enemies;
  </code></pre>
  
  <p>Now, the next clue I get in the compiler output is the line 47 in basesource.cpp:</p>
  
  <pre><code>std::list&lt;PEnemy&gt; enemies = Game::LEVEL-&gt;getEnemies();
  </code></pre>
  
  <p>Why does this cause problems? How can I fix the error?</p>