Smart pointers (since C++11)
Smart pointers enable automatic, exception-safe, object lifetime management.
Defined in header
Pointer categories
(C++11)
smart pointer with unique object ownership semantics
(class template)
(C++11)
smart pointer with shared object ownership semantics
(class template)
(C++11)
weak reference to an object managed by
(class template)
(deprecated in C++11)(removed in C++17)
smart pointer with strict object ownership semantics
(class template)
Helper classes
(C++11)
provides mixed-type owner-based ordering of shared and weak pointers
(class template)
(C++26)
provides owner-based hashing for shared and weak pointers
(class)
(C++26)
provides mixed-type owner-based equal comparisons of shared and weak pointers
(class)
(C++11)
allows an object to create a shared_ptr referring to itself
(class template)
(C++11)
exception thrown when accessing a weak_ptr which refers to already destroyed object
(class)
(C++11)
default deleter for
(class template)
Smart pointer adaptors (since C++23)
(C++23)
interoperates with foreign pointer setters and resets a smart pointer on destruction
(class template)
(C++23)
creates an out_ptr_t with an associated smart pointer and resetting arguments
(function template)
(C++23)
interoperates with foreign pointer setters, obtains the initial pointer value from a smart pointer, and resets it on destruction
(class template)
(C++23)
creates an inout_ptr_t with an associated smart pointer and resetting arguments
(function template)
Allocators
Allocators are class templates encapsulating memory allocation strategy. This allows generic containers to decouple memory management from the data itself.
Defined in header
the default allocator
(class template)
(C++11)
provides information about allocator types
(class template)
(C++23)
records the address and the actual size of storage allocated by allocate_at_least
(class template)
(C++11)
a tag used to select allocator-aware constructors
(tag)
(C++11)
checks if the specified type supports uses-allocator construction
(class template)
uses_allocator_construction_args
(C++20)
prepares the argument list matching the flavor of uses-allocator construction required by the given type
(function template)
(C++20)
creates an object of the given type by means of uses-allocator construction
(function template)
uninitialized_construct_using_allocator
(C++20)
creates an object of the given type at specified memory location by means of uses-allocator construction
(function template)
Defined in header
(C++11)
implements multi-level allocator for multi-level containers
(class template)
Defined in header
Defined in namespace std::pmr
(C++17)
an allocator that supports run-time polymorphism based on the
it is constructed with
(class template)
Memory resources (since C++17)
Memory resources implement memory allocation strategies that can be used by
std::pmr::polymorphic_allocator
.
Defined in header
Defined in namespace std::pmr
(C++17)
an abstract interface for classes that encapsulate memory resources
(class)
(C++17)
returns a static program-wide
that uses the global
and
to allocate and deallocate memory
(function)
(C++17)
returns a static
that performs no allocation
(function)
(C++17)
gets the default
(function)
(C++17)
sets the default
(function)
(C++17)
a set of constructor options for pool resources
(class)
(C++17)
a thread-safe
for managing allocations in pools of different block sizes
(class)
(C++17)
a thread-unsafe
for managing allocations in pools of different block sizes
(class)
(C++17)
a special-purpose
that releases the allocated memory only when the resource is destroyed
(class)
Specialized <memory> algorithms
Explicit lifetime management (since C++23)
Types for composite class design (since C++26)
(C++26)
a wrapper containing dynamically-allocated object with value-like semantics
(class template)
(C++26)
a polymorphic wrapper containing dynamically-allocated object with value-like semantics
(class template)
Miscellaneous
Defined in header
(C++11)
provides information about pointer-like types
(class template)
(C++20)
obtains a raw pointer from a pointer-like type
(function template)
(C++11)
obtains actual address of an object, even if the & operator is overloaded
(function template)
(C++11)
aligns a pointer in a buffer
(function)
(C++20)
informs the compiler that a pointer is aligned
(function template)
(C++26)
checks whether the pointer points to an object whose alignment has at least the given value
(function template)
Includes e.g.
,
,
.
Includes e.g.
,
.
Uninitialized storage (until C++20)
Several utilities are provided to create and access raw storage.
Garbage collector support (until C++23)
Defined in header
(C++11)(removed in C++23)
declares that an object can not be recycled
(function)
(C++11)(removed in C++23)
declares that an object can be recycled
(function template)
(C++11)(removed in C++23)
declares that a memory area does not contain traceable pointers
(function)
(C++11)(removed in C++23)
cancels the effect of
(function)
(C++11)(removed in C++23)
lists pointer safety models
(enum)
(C++11)(removed in C++23)
returns the current pointer safety model
(function)