title: c++ std::unique_ptr won't compile in map
body: <p>I'm currently trying to store a std::unique_ptr in a std::unordered_map, but I get a weird compile error.
  Relevant code:</p>
  
  <pre><code>#pragma once
  
  #include "Entity.h"
  
  #include &lt;map&gt;
  #include &lt;memory&gt;
  
  class EntityManager {
  private:
      typedef std::unique_ptr&lt;Entity&gt; EntityPtr;
      typedef std::map&lt;int, EntityPtr&gt; EntityMap;
  
      EntityMap map;
  public:
  
      /*
      Adds an Entity
      */
      void addEntity(EntityPtr);
  
      /*
      Removes an Entity by its ID
      */
      void removeEntity(int id) {
          map.erase(id);
      }
  
      Entity&amp; getById(int id) {
          return *map[id];
      }
  };
  
  void EntityManager::addEntity(EntityPtr entity) {
      if (!entity.get()) {
          return;
      }
  
      map.insert(EntityMap::value_type(entity-&gt;getId(), std::move(entity)));
  }
  </code></pre>
  
  <p>This is the compile error:  </p>
  
  <pre><code>c:\program files (x86)\microsoft visual studio 12.0\vc\include\tuple(438): error C2280: 'std::unique_ptr&lt;Entity,std::default_delete&lt;_Ty&gt;&gt;::unique_ptr(const std::unique_ptr&lt;_Ty,std::default_delete&lt;_Ty&gt;&gt; &amp;)' : attempting to reference a deleted function
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=Entity
  1&gt;          ]
  1&gt;          c:\program files (x86)\microsoft visual studio 12.0\vc\include\memory(1486) : see declaration of 'std::unique_ptr&lt;Entity,std::default_delete&lt;_Ty&gt;&gt;::unique_ptr'
  1&gt;          with
  1&gt;          [
  1&gt;              _Ty=Entity
  1&gt;          ]
  1&gt;          This diagnostic occurred in the compiler generated function 'std::pair&lt;const _Kty,_Ty&gt;::pair(const std::pair&lt;const _Kty,_Ty&gt; &amp;)'
  1&gt;          with
  1&gt;          [
  1&gt;              _Kty=int
  1&gt;  ,            _Ty=EntityManager::EntityPtr
  1&gt;          ]
  </code></pre>