Memory management library
From cppreference.com
< cpp
C++
Feature test macros (C++20)
Concepts library (C++20)
Memory management library
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Memory management library
(exposition only*)
(C++11)
(C++23)
(C++11)
(C++17)
(C++11)
(C++11)
(C++20)
(C++20)
(C++17)
(C++11)
(C++17)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
Uninitialized storage (until C++20)
(until C++20*)
(until C++20*)
(until C++20*)
Garbage collector support (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)
(C++11)(until C++23)
(C++11)
(C++11)
(C++17)
(C++20)
(C++17)
(C++11)
(C++11)
(C++11)
(until C++17*)
(C++11)
(C++17)
(C++26)
(C++26)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++11)
(C++20)
(C++11)
(C++11)
(C++20)
(C++26)
Contents
- 1 Smart pointers (since C++11)
- 2 Allocators
- 3 Memory resources (since C++17)
- 4 Uninitialized memory algorithms
- 5 Constrained uninitialized memory algorithms (since C++20)
- 6 Explicit lifetime management (since C++23)
- 7 Types for composite class design (since C++26)
- 8 Miscellaneous
- 9 Low level memory management
- 10 C-style memory management
- 11 Uninitialized storage (until C++20)
- 12 Garbage collector support (until C++23)
[edit] Smart pointers (since C++11)
Smart pointers enable automatic, exception-safe, object lifetime management.
Defined in header
<memory>
Pointer categories
(deprecated in C++11)(removed in C++17)
(class template) [edit]
Helper classes
(C++11)
(class template) [edit]
(C++26)
(class) [edit]
(C++11)
weak_ptr
which refers to already destroyed object (class) [edit]
Smart pointer adaptors (since C++23)
(C++23)
(class template) [edit]
(C++23)
out_ptr_t
with an associated smart pointer and resetting arguments (function template) [edit]
(C++23)
(class template) [edit]
(C++23)
inout_ptr_t
with an associated smart pointer and resetting arguments (function template) [edit]
[edit] Allocators
Allocators are class templates encapsulating memory allocation strategy. This allows generic containers to decouple memory management from the data itself.
Defined in header
<memory>
(C++23)
allocate_at_least
(class template) [edit]
(C++20)
(function template) [edit]
(C++20)
(function template) [edit]
creates an object of the given type at specified memory location by means of uses-allocator construction
(function template) [edit]
(function template) [edit]
Defined in header
<scoped_allocator>
Defined in header
<memory_resource>
Defined in namespace
std::pmr
(C++17)
(class template) [edit]
[edit] Memory resources (since C++17)
Memory resources implement memory allocation strategies that can be used by std::pmr::polymorphic_allocator .
Defined in header
<memory_resource>
Defined in namespace
std::pmr
(C++17)
(function) [edit]
(C++17)
(class) [edit]
(C++17)
(class) [edit]
(C++17)
(class) [edit]
[edit] Uninitialized memory algorithms
Defined in header
<memory>
copies an object to an uninitialized area of memory, defined by a start and a count
(function template) [edit]
(function template) [edit]
(C++17)
(function template) [edit]
constructs objects by default-initialization in an uninitialized area of memory, defined by a start and a count
(function template) [edit]
(function template) [edit]
(C++17)
(function template) [edit]
(C++17)
(function template) [edit]
[edit] Constrained uninitialized memory algorithms (since C++20)
C++20 provides constrained uninitialized memory algorithms that accept range arguments or iterator-sentinel pairs.
Defined in header
<memory>
Defined in namespace
std::ranges
specifies some operations on iterators, sentinels and ranges are non-throwing
(exposition-only concept*)
(exposition-only concept*)
(C++20)
(algorithm function object)[edit]
(C++20)
(algorithm function object)[edit]
(C++20)
(algorithm function object)[edit]
(C++20)
(algorithm function object)[edit]
(C++20)
(algorithm function object)[edit]
(C++20)
(algorithm function object)[edit]
constructs objects by default-initialization in an uninitialized area of memory, defined by a range
(algorithm function object)[edit]
(algorithm function object)[edit]
constructs objects by default-initialization in an uninitialized area of memory, defined by a start and count
(algorithm function object)[edit]
(algorithm function object)[edit]
constructs objects by value-initialization in an uninitialized area of memory, defined by a range
(algorithm function object)[edit]
(algorithm function object)[edit]
constructs objects by value-initialization in an uninitialized area of memory, defined by a start and a count
(algorithm function object)[edit]
(algorithm function object)[edit]
[edit] Explicit lifetime management (since C++23)
Defined in header
<memory>
implicitly creates objects in given storage with the object representation reused
(function template) [edit]
(function template) [edit]
[edit] Types for composite class design (since C++26)
Defined in header
<memory>
(C++26)
(class template) [edit]
(C++26)
(class template) [edit]
[edit] Miscellaneous
Defined in header
<memory>
(C++11)
&
operator is overloaded (function template) [edit]
(C++26)
(function template) [edit]
[edit] Low level memory management
Includes e.g. operator new , operator delete , std::set_new_handler .
Defined in header
<new>
[edit] C-style memory management
Includes e.g. std::malloc , std::free .
Defined in header
<cstdlib>
[edit] Uninitialized storage (until C++20)
Several utilities are provided to create and access raw storage.
Defined in header
<memory>
(deprecated in C++17)(removed in C++20)
(class template) [edit]
[edit] Garbage collector support (until C++23)
Defined in header
<memory>
(C++11)(removed in C++23)
(function) [edit]