title: std::shared_ptr assignment of data vs. memcpy
body: <p>I am using std::shared_ptr in C++11 and I would like to understand if it's better to assign structures of type T in this way:</p>
  
  <pre><code>T a_data;
  std::shared_ptr&lt;T&gt; my_pointer(new T);
  *my_pointer = a_data;
  </code></pre>
  
  <p>or like:</p>
  
  <pre><code>memcpy(&amp;my_pointer, data, sizeof(T));
  </code></pre>
  
  <p>or like:</p>
  
  <pre><code>my_pointer.reset(a_data);
  </code></pre>
  
  <p>Regards</p>
  
  <p>Mike</p>