Why are non-placement `new` and `delete` built into the language and not just regular functions? : <p>Why were the non-placement <a href="http://en.cppreference.com/w/cpp/language/new" rel="noreferrer"><code>new</code> expression</a> and the <a href="http://en.cppreference.com/w/cpp/language/delete" rel="noreferrer"><code>delete</code> expression</a> implemented as language built-in instead of regular functions?</p>

<p>If we have...</p>

<ul>
<li><p>a way of requesting/giving back memory to the OS</p></li>
<li><p>a way of explicitly invoking a constructor <em>(placement <code>new</code>)</em></p></li>
<li><p>a way of explicitly invoking a destructor <em>(<code>~T()</code>)</em></p></li>
</ul>

<p>...why couldn't non-placement <code>new</code> and <code>delete</code> just be regular functions in the Standard Library? Example:</p>

<pre><code>template &lt;typename T, typename... Ts&gt;
T* library_new(Ts&amp;&amp;... xs)
{
    auto* ptr = /* request enough memory for `T` from OS */;
    new (ptr) T(std::forward&lt;Ts&gt;(xs)...);
    return ptr;
}

template &lt;typename T&gt;
void library_delete(T* ptr)
{
    ptr-&gt;~T();
    /* reclaim memory for `T` from OS */
} 
</code></pre>
