Advantages of using std::make_unique over new operator
<p>What are the advantages of using <code>std::make_unique</code> over the <code>new</code> operator for initializing a <code>std::unique_ptr</code>? </p>

<p>In other words, why is </p>

<pre><code>std::unique_ptr&lt;SomeObject&gt; a = std::make_unique(SomeObject(...))
</code></pre>

<p>better than doing</p>

<pre><code>std::unique_ptr&lt;SomeObject&gt; a = new SomeObject(...)
</code></pre>

<p>I tried looking up a lot online and I do know that it is a good rule of thumb to avoid the operator <code>new</code> in modern C++, but I am not sure what the advantages are in this exact scenario. Does it prevent any kind of memory leaks that might happen? Is it faster to do a <code>std::make_unique</code> than to use <code>new</code>? </p>