Placement syntax: Difference between revisions

Content deleted Content added
fix ref
improve refs
Line 4:
In the [[C++]] [[programming language]], placement new is a form of the [[New_(C++)|new]] operator that allows object construction into an existing [[memory]] buffer. Unlike other forms of <code>new</code>, the new object does not have to be in heap [[memory]]. The [[Pointer (computing)|pointer]] returned by the placement new is the [[Pointer (computing)|pointer]] provided as an argument [[Type_conversion|casted]] to the type of the new object.
 
Placement new is necessary for hardware that expects a certain object at a specific hardware address. It is also required for the construction of objects that need to reside in a certain memory area, such as an area that is shared between several processors of a multiprocessor computer.<ref name="DE">{{Citation | last1=Stroustrup | first1=Bjarne | author1-link=Bjarne Stroustrup | title=Design and Evolution of C++ | publisher=[[Addison-Wesley]] | isbn=978-0-201-54330-8 | year=1994 }}, section Memory Management.</ref>
 
==Syntax==
Line 29:
<references/>
 
* {{Citation | last1=Stroustrup | first1=Bjarne | author1-link=Bjarne Stroustrup | title=The C++ Programming Language | publisher=[[Addison-Wesley]] | edition=third | isbn=978-0-201-88954-3 | year=1997}}
* [http://publib.boulder.ibm.com/infocenter/macxhelp/v6v81/index.jsp?topic=/com.ibm.vacpp6m.doc/language/ref/clrc05cplr199.htm IBM Documentation describing C++'s operator new]
* [http://msdn2.microsoft.com/en-us/library/kewsb8ba(VS.71).aspx Microsoft Visual Studio operator new documentation]