Difference between revisions of "cpp/memory/new"
From cppreference.com
(various updates. Perhaps this could be merged into cpp/memory? It's a major topic.) |
(dcl templates) |
||
Line 7: | Line 7: | ||
{{dcl list header |new}} | {{dcl list header |new}} | ||
{{dcl list h2 | Functions}} | {{dcl list h2 | Functions}} | ||
− | {{dcl list | + | {{dcl list template | cpp/memory/new/dcl list operator_new}} |
− | {{dcl list | + | {{dcl list template | cpp/memory/new/dcl list operator_delete}} |
− | {{dcl list | + | {{dcl list template | cpp/memory/new/dcl list get_new_handler}} |
− | {{dcl list | + | {{dcl list template | cpp/memory/new/dcl list set_new_handler}} |
{{dcl list h2 | Classes }} | {{dcl list h2 | Classes }} | ||
− | {{dcl list | + | {{dcl list template | cpp/memory/new/dcl list bad_alloc}} |
− | {{dcl list | + | {{dcl list template | cpp/memory/new/dcl list bad_array_new_length}} |
− | {{dcl list | + | {{dcl list template | cpp/memory/new/dcl list nothrow_t}} |
{{dcl list h2 | Types }} | {{dcl list h2 | Types }} | ||
− | {{dcl list | + | {{dcl list template | cpp/memory/new/dcl list new_handler}} |
{{dcl list h2 | Objects}} | {{dcl list h2 | Objects}} | ||
− | {{dcl list | + | {{dcl list template | cpp/memory/new/dcl list nothrow}} |
{{dcl list end}} | {{dcl list end}} |
Revision as of 07:16, 28 October 2011
Template:cpp/memory/new/sidebar
The new-expression is the only way to create an object or an array of objects with dynamic storage duration, that is, with lifetime not restricted to the scope in which it is created. A new-expression obtains storage by calling an allocation function. A delete-expression destroys a most derived object or an array created by a new-expression and calls the deallocation function. The default allocation and deallocation functions, along with related functions, types, and objects, are declared in the header <new>
.