Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/memory/new"

From cppreference.com
< cpp‎ | memory
m (~{{header|new}})
m (reclassified)
Line 14: Line 14:
 
{{dsc inc | cpp/memory/new/dsc bad_alloc}}
 
{{dsc inc | cpp/memory/new/dsc bad_alloc}}
 
{{dsc inc | cpp/memory/new/dsc bad_array_new_length}}
 
{{dsc inc | cpp/memory/new/dsc bad_array_new_length}}
{{dsc inc | cpp/memory/new/dsc nothrow_t}}
 
 
{{dsc inc | cpp/memory/new/dsc align_val_t}}
 
{{dsc inc | cpp/memory/new/dsc align_val_t}}
{{dsc inc | cpp/memory/new/dsc destroying_delete_t}}
 
 
{{dsc h2 | Types }}
 
{{dsc h2 | Types }}
 
{{dsc inc | cpp/memory/new/dsc new_handler}}
 
{{dsc inc | cpp/memory/new/dsc new_handler}}
 
{{dsc h2 | Objects}}
 
{{dsc h2 | Objects}}
 
{{dsc inc | cpp/memory/new/dsc nothrow}}
 
{{dsc inc | cpp/memory/new/dsc nothrow}}
 +
{{dsc inc | cpp/memory/new/dsc destroying_delete}}
 
{{dsc end}}
 
{{dsc end}}
  
[[de:cpp/memory/new]]
+
 
[[es:cpp/memory/new]]
+
{{langlinks|de|es|fr|it|ja|pt|ru|zh}}
[[fr:cpp/memory/new]]
+
[[it:cpp/memory/new]]
+
[[ja:cpp/memory/new]]
+
[[pt:cpp/memory/new]]
+
[[ru:cpp/memory/new]]
+
[[zh:cpp/memory/new]]
+

Revision as of 18:29, 24 April 2022

 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
Dynamic memory management
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Allocators
Garbage collection support
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)
(C++11)(until C++23)



 
 

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>.

Defined in header <new>

Contents

Functions
allocation functions
(function) [edit]
deallocation functions
(function) [edit]
obtains the current new handler
(function) [edit]
registers a new handler
(function) [edit]
Classes
exception thrown when memory allocation fails
(class) [edit]
exception thrown on allocation of array with invalid length
(class) [edit]
type used to pass alignment to alignment-aware allocation and deallocation functions
(enum) [edit]
Types
function pointer type of the new handler
(typedef) [edit]
Objects
a tag used to select a non-throwing allocation function
(tag)[edit]
a tag used to select destroying-delete overloads of operator delete
(tag)[edit]