title: How to properly duplicate an object given its shared_ptr
body: <p>I'm trying to make a duplicate of an object of a custom class <code>Event</code>. I have a shared pointer to the object that I've obtained from its allocation:</p>
  
  <pre><code>std::shared_ptr&lt;Event&gt; e = std::make_shared&lt;Event&gt;();
  </code></pre>
  
  <p>In order to get a true duplicate of <code>e</code> (not just a copy of the pointer) I've tried:</p>
  
  <pre><code>std::shared_ptr&lt;Event&gt; o = std::make_shared&lt;Event&gt;(*e);
  </code></pre>
  
  <p>But I'm not sure if this is the correct way as it seems that if I delete <code>e</code> it also deletes <code>o</code>...</p>
  
  <p>Btw, I haven't defined a copy constructor <code>Event::Event(const Event &amp;orig)</code> but in my understanding this is not necessary as the compiler provides a default copy constructor. The event class only contains variables and no further pointers.</p>