title: placement new VS explicit constructor call in C++
body: <p>recently I have come across these two ways of creating an object in a specific place in memory:
  <br />
  1. <br /></p>
  
  <pre><code>void* mem = malloc(sizeof(T));
  T* obj = new(mem) T();
  </code></pre>
  
  <p><br />
  2.<br /></p>
  
  <pre><code>T* obj = (T*)malloc(sizeof(T));
  *obj = T();
  </code></pre>
  
  <p>The second way is a bit shorter...are there other differences?
  Regards
  Mateusz</p>