title: Should I use shared_ptr or unique_ptr
body: <p>I've been making some objects using the pimpl idiom, but I'm not sure whether to use <a href="http://en.cppreference.com/w/cpp/memory/shared_ptr"><code>std::shared_ptr</code></a> or <a href="http://en.cppreference.com/w/cpp/memory/unique_ptr"><code>std::unique_ptr</code></a>. </p>
  
  <p>I understand that <code>std::unique_ptr</code> is more efficient, but this isn't so much of an issue for me, as these objects are relatively heavyweight anyway so the cost of <code>std::shared_ptr</code> over <code>std::unique_ptr</code> is relatively minor.</p>
  
  <p>I'm currently going with <code>std::shared_ptr</code> just because of the extra flexibility. For example, using a <code>std::shared_ptr</code> allows me to store these objects in a hashmap for quick access while still being able to return copies of these objects to callers (as I believe any iterators or references may quickly become invalid).</p>
  
  <p>However, these objects in a way really aren't being copied, as changes affect all copies, so I was wondering that perhaps using <code>std::shared_ptr</code> and allowing copies is some sort of anti-pattern or bad thing.</p>
  
  <p>Is this correct?</p>