Placement syntax: Difference between revisions

Content deleted Content added
m Updated the section on security and corrected a date error on [16] citation
ERCaGuy (talk | contribs)
Fix incorrect wording
Line 3:
The "placement" versions of the <code>[[new (C++)|new]]</code> and <code>[[delete (C++)|delete]]</code> operators and functions are known as placement <code>new</code> and placement <code>delete</code>.<ref name=McCluskey2000 /> A <code>new</code> ''expression'', placement or otherwise, calls a <code>new</code> ''function'', also known as an allocator function, whose name is <code>operator new</code>. Similarly, a <code>delete</code> ''expression'' calls a <code>delete</code> ''function'', also known as a deallocator function, whose name is <code>operator delete</code>.<ref name=Lischner2003 /><ref name=Lippman1997 />
 
Any <code>new</code> expression that uses the placement syntax is a placement <code>new</code> expression, and any <code>operator new</code> or <code>operator delete</code> function that takes more than the mandatory first parameter (<syntaxhighlight lang="cpp" enclose=none>std::size_t</syntaxhighlight> and <syntaxhighlight lang="cpp" enclose=none>void *</syntaxhighlight>, respectively) is a placement new or placement delete function.<ref name=Meyers1998 /> A placement new function takes two input parameters: <syntaxhighlight lang="cpp" enclose=none>std::size_t</syntaxhighlight> and <syntaxhighlight lang="cpp" enclose=none>void *</syntaxhighlight>.
 
== History ==