title: access unique_ptr elements in container
body: <p>I have an unordered_map of unique_ptr elements. When I want to access the elements I have to move them and insert them back once I'm done using them.</p>
  
  <pre><code>std::unordered_map&lt;std::string,std::unique_ptr&lt;MyClass&gt;&gt;
  
  auto myClass = std::move(Program::cache["my_class"]);
  // do something with myClass...
  Program::cache["my_class"] = std::move(myClass);
  </code></pre>
  
  <p>This seems very expensive so I thought using references </p>
  
  <pre><code>MyClass const&amp; myClass = *Program::cache["my_class"];
  or
  auto myClass = *Program::cach["my_class"];
  </code></pre>
  
  <p>But this seems unnatural. Is this a common usage of containers and unique_ptr? If not what'd be the best practice? </p>