Content deleted Content added
Clarified template argument. |
Fixed template parameters. |
||
Line 17:
Up until version 2.2.2, this was the ''only'' placement syntax that that compiler would accept.<ref name=Buck1 />
== Functions ==
The placement new functions are overloads of the non-placement new functions. The declaration of the non-placement new functions, for non-array and array <code>new</code> expressions respectively, are:<ref name=Vermeir1>{{cite book|title=Multi-paradigm Programming Using C++|author=Dirk Vermeir|pages=113–115|publisher=Springer|date=2001|isbn=1852334835|isbn13=9781852334833}}</ref><ref name=TCPPPL>{{cite book|last=Stroustrup|first=Bjarne|
:<source lang="cpp" enclose=div>
void * operator new (size_t) throw(std::bad_alloc);
Line 66:
There are various uses for default placement.
[[Bjarne Stroustrup]] originally observed, in his book ''The Design and Evolution of C++'', that pointer 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=DAEOC>{{cite book|last=Stroustrup|first=Bjarne|
Other uses, however, include calling a constructor directly, something which the C++ language does not otherwise permit.<ref name=Lippman1 />
|