C++ Standard Library C++ STL Library

C++ - <memory>



This header is part of the dynamic memory management library and defines general utilities to manage dynamic memory:

Library Classes

Pointer traits

ClassesDescription
pointer_traits Provides information about pointer-like types

Garbage collector support

ClassesDescription
pointer_safety Lists pointer safety models (enum)

Allocators

ClassesDescription
allocator The default allocator
allocator_arg_t Tag type used to select allocator-aware constructor overloads
allocator_traits (C++11) Provides information about allocator types

smart pointers

ClassesDescription
auto_ptr Automatic Pointer [deprecated]
shared_ptr Shared pointer
weak_ptr Weak shared pointer
unique_ptr Unique pointer

Uninitialized storage

ClassesDescription
raw_storage_iterator An iterator that allows standard algorithms to store results in uninitialized memory

Helper classes

ClassesDescription
default_delete Default deleter
owner_less Owner-based less-than operation
enable_shared_from_this Enable shared_from_this

Library Constants

ConstantsDescription
allocator_arg an object of type allocator_arg_t used to select allocator-aware constructors

Library Functions

Garbage collector support

FunctionsDescription
declare_reachable Declare pointer as reachable
undeclare_reachable Undeclare pointer as reachable
declare_no_pointers Declare memory block as containing no pointers
undeclare_no_pointers Undeclare memory block as containing no pointers
get_pointer_safety Get pointer safety

Uninitialized storage

FunctionsDescription
uninitialized_copy Copy block of memory
uninitialized_copy_n Copy block of memory
uninitialized_fill Fill block of memory
uninitialized_fill_n Fill block of memory
get_temporary_buffer Get block of temporary memory
return_temporary_buffer Return block of temporary memory

Smart pointer non-member operations

FunctionsDescription
make_shared Make shared_ptr
allocate_shared Allocate shared_ptr
static_pointer_cast Static cast of shared_ptr
dynamic_pointer_cast Dynamic cast of shared_ptr
const_pointer_cast Const cast of shared_ptr
get_deleter Get deleter from shared_ptr

Miscellaneous

FunctionsDescription
align Align in range
addressof Address of object or function