[memory.syn] # 20 Memory management library [[mem]](./#mem) ## 20.2 Memory [[memory]](memory#syn) ### 20.2.2 Header synopsis [memory.syn] [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L33) The header defines several types and function templates that describe properties of pointers and pointer-like types, manage memory for containers and other template types, destroy objects, and construct objects in uninitialized memory buffers ([[pointer.traits]](pointer.traits "20.2.3 Pointer traits")–[[specialized.addressof]](specialized.addressof "20.2.11 addressof") and [[specialized.algorithms]](specialized.algorithms "26.11 Specialized algorithms"))[.](#1.sentence-1) The header also defines the templatesunique_ptr, shared_ptr, weak_ptr,out_ptr_t, inout_ptr_t, and various function templates that operate on objects of these types ([[smartptr]](smartptr "20.3 Smart pointers"))[.](#1.sentence-2) [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L45) Let *POINTER_OF*(T) denote a type that is - [(2.1)](#2.1) T​::​pointer if the [*qualified-id*](expr.prim.id.qual#nt:qualified-id "7.5.5.3 Qualified names [expr.prim.id.qual]") T​::​pointer is valid and denotes a type, - [(2.2)](#2.2) otherwise, T​::​element_type* if the [*qualified-id*](expr.prim.id.qual#nt:qualified-id "7.5.5.3 Qualified names [expr.prim.id.qual]") T​::​element_type is valid and denotes a type, - [(2.3)](#2.3) otherwise, pointer_traits​::​element_type*[.](#2.sentence-1) [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/memory.tex#L59) Let *POINTER_OF_OR*(T, U) denote a type that is: - [(3.1)](#3.1) *POINTER_OF*(T) if *POINTER_OF*(T) is valid and denotes a type, - [(3.2)](#3.2) otherwise, U[.](#3.sentence-1) #include // see [[compare.syn]](compare.syn "17.12.1 Header synopsis")namespace std {// [[pointer.traits]](pointer.traits "20.2.3 Pointer traits"), pointer traitstemplate struct pointer_traits; // freestandingtemplate struct pointer_traits; // freestanding// [[pointer.conversion]](pointer.conversion "20.2.4 Pointer conversion"), pointer conversiontemplateconstexpr T* to_address(T* p) noexcept; // freestandingtemplateconstexpr auto to_address(const Ptr& p) noexcept; // freestanding// [[ptr.align]](ptr.align "20.2.5 Pointer alignment"), pointer alignmentvoid* align(size_t alignment, size_t size, void*& ptr, size_t& space); // freestandingtemplateconstexpr T* assume_aligned(T* ptr); // freestandingtemplatebool is_sufficiently_aligned(T* ptr); // [[obj.lifetime]](obj.lifetime "20.2.6 Explicit lifetime management"), explicit lifetime managementtemplate T* start_lifetime_as(void* p) noexcept; // freestandingtemplateconst T* start_lifetime_as(const void* p) noexcept; // freestandingtemplatevolatile T* start_lifetime_as(volatile void* p) noexcept; // freestandingtemplateconst volatile T* start_lifetime_as(const volatile void* p) noexcept; // freestandingtemplate T* start_lifetime_as_array(void* p, size_t n) noexcept; // freestandingtemplateconst T* start_lifetime_as_array(const void* p, size_t n) noexcept; // freestandingtemplatevolatile T* start_lifetime_as_array(volatile void* p, size_t n) noexcept; // freestandingtemplateconst volatile T* start_lifetime_as_array(const volatile void* p, // freestanding size_t n) noexcept; template T* trivially_relocate(T* first, T* last, T* result); // freestandingtemplateconstexpr T* relocate(T* first, T* last, T* result); // freestanding// [[allocator.tag]](allocator.tag "20.2.7 Allocator argument tag"), allocator argument tagstruct allocator_arg_t { explicit allocator_arg_t() = default; }; // freestandinginline constexpr allocator_arg_t allocator_arg{}; // freestanding// [[allocator.uses]](allocator.uses "20.2.8 uses_­allocator"), uses_allocatortemplate struct uses_allocator; // freestanding// [[allocator.uses.trait]](allocator.uses.trait "20.2.8.1 uses_­allocator trait"), uses_allocatortemplateconstexpr bool [uses_allocator_v](#lib:uses_allocator_v "20.2.2 Header synopsis [memory.syn]") = uses_allocator::value; // freestanding// [[allocator.uses.construction]](allocator.uses.construction "20.2.8.2 Uses-allocator construction"), uses-allocator constructiontemplateconstexpr auto uses_allocator_construction_args(const Alloc& alloc, // freestanding Args&&... args) noexcept; templateconstexpr auto uses_allocator_construction_args(const Alloc& alloc, // freestanding piecewise_construct_t, Tuple1&& x, Tuple2&& y) noexcept; templateconstexpr auto uses_allocator_construction_args(const Alloc& alloc) noexcept; // freestandingtemplateconstexpr auto uses_allocator_construction_args(const Alloc& alloc, // freestanding U&& u, V&& v) noexcept; templateconstexpr auto uses_allocator_construction_args(const Alloc& alloc, // freestanding pair& pr) noexcept; templateconstexpr auto uses_allocator_construction_args(const Alloc& alloc, // freestandingconst pair& pr) noexcept; templateconstexpr auto uses_allocator_construction_args(const Alloc& alloc, // freestanding pair&& pr) noexcept; templateconstexpr auto uses_allocator_construction_args(const Alloc& alloc, // freestandingconst pair&& pr) noexcept; template synopsis [tuple.syn]") P>constexpr auto uses_allocator_construction_args(const Alloc& alloc, // freestanding P&& p) noexcept; templateconstexpr auto uses_allocator_construction_args(const Alloc& alloc, // freestanding U&& u) noexcept; templateconstexpr T make_obj_using_allocator(const Alloc& alloc, Args&&... args); // freestandingtemplateconstexpr T* uninitialized_construct_using_allocator(T* p, // freestandingconst Alloc& alloc, Args&&... args); // [[allocator.traits]](allocator.traits "20.2.9 Allocator traits"), allocator traitstemplate struct allocator_traits; // freestandingtemplatestruct allocation_result { // freestanding Pointer ptr; SizeType count; }; // [[default.allocator]](default.allocator "20.2.10 The default allocator"), the default allocatortemplate class allocator; templateconstexpr bool operator==(const allocator&, const allocator&) noexcept; // [[specialized.addressof]](specialized.addressof "20.2.11 addressof"), addressoftemplateconstexpr T* addressof(T& r) noexcept; // freestandingtemplateconst T* addressof(const T&&) = delete; // freestanding// [[specialized.algorithms]](specialized.algorithms "26.11 Specialized algorithms"), specialized algorithms// [[special.mem.concepts]](special.mem.concepts "26.11.2 Special memory concepts"), special memory conceptstemplateconcept [*nothrow-input-iterator*](special.mem.concepts#concept:nothrow-input-iterator "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-bidirectional-iterator*](special.mem.concepts#concept:nothrow-bidirectional-iterator "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-sentinel-for*](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-sized-sentinel-for*](special.mem.concepts#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-input-range*](special.mem.concepts#concept:nothrow-input-range "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-forward-range*](special.mem.concepts#concept:nothrow-forward-range "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-bidirectional-range*](special.mem.concepts#concept:nothrow-bidirectional-range "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-random-access-range*](special.mem.concepts#concept:nothrow-random-access-range "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconcept [*nothrow-sized-random-access-range*](special.mem.concepts#concept:nothrow-sized-random-access-range "26.11.2 Special memory concepts [special.mem.concepts]") = *see below*; // *exposition only*templateconstexpr void uninitialized_default_construct(NoThrowForwardIterator first, // freestanding NoThrowForwardIterator last); templatevoid uninitialized_default_construct(ExecutionPolicy&& exec, // freestanding-deleted, NoThrowForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") NoThrowForwardIterator last); templateconstexpr NoThrowForwardIterator uninitialized_default_construct_n(NoThrowForwardIterator first, Size n); // freestandingtemplate NoThrowForwardIterator uninitialized_default_construct_n(ExecutionPolicy&& exec, // freestanding-deleted, NoThrowForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") Size n); namespace ranges {template<[*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, [*nothrow-sentinel-for*](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")>constexpr I uninitialized_default_construct(I first, S last); // freestandingtemplate<[*nothrow-forward-range*](special.mem.concepts#concept:nothrow-forward-range "26.11.2 Special memory concepts [special.mem.concepts]") R>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")>constexpr borrowed_iterator_t uninitialized_default_construct(R&& r); // freestandingtemplate<[*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")>constexpr I uninitialized_default_construct_n(I first, // freestanding iter_difference_t n); template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, [*nothrow-sized-sentinel-for*](special.mem.concepts#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")> I uninitialized_default_construct(Ep&& exec, I first, S last); // freestanding-deleted,// see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-sized-random-access-range*](special.mem.concepts#concept:nothrow-sized-random-access-range "26.11.2 Special memory concepts [special.mem.concepts]") R>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")> borrowed_iterator_t uninitialized_default_construct(Ep&& exec, // freestanding-deleted, R&& r); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")> I uninitialized_default_construct_n(Ep&& exec, I first, // freestanding-deleted, iter_difference_t n); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")}templateconstexpr void uninitialized_value_construct(NoThrowForwardIterator first, // freestanding NoThrowForwardIterator last); templatevoid uninitialized_value_construct(ExecutionPolicy&& exec, // freestanding-deleted, NoThrowForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") NoThrowForwardIterator last); templateconstexpr NoThrowForwardIterator uninitialized_value_construct_n(NoThrowForwardIterator first, Size n); // freestandingtemplate NoThrowForwardIterator uninitialized_value_construct_n(ExecutionPolicy&& exec, // freestanding-deleted, NoThrowForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") Size n); namespace ranges {template<[*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, [*nothrow-sentinel-for*](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")>constexpr I uninitialized_value_construct(I first, S last); // freestandingtemplate<[*nothrow-forward-range*](special.mem.concepts#concept:nothrow-forward-range "26.11.2 Special memory concepts [special.mem.concepts]") R>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")>constexpr borrowed_iterator_t uninitialized_value_construct(R&& r); // freestandingtemplate<[*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")>constexpr I uninitialized_value_construct_n(I first, // freestanding iter_difference_t n); template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, [*nothrow-sized-sentinel-for*](special.mem.concepts#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")> I uninitialized_value_construct(Ep&& exec, I first, S last); // freestanding-deleted,// see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-sized-random-access-range*](special.mem.concepts#concept:nothrow-sized-random-access-range "26.11.2 Special memory concepts [special.mem.concepts]") R>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")> borrowed_iterator_t uninitialized_value_construct(Ep&& exec, // freestanding-deleted, R&& r); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")> I uninitialized_value_construct_n(Ep&& exec, I first, // freestanding-deleted, iter_difference_t n); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")}templateconstexpr NoThrowForwardIterator uninitialized_copy(InputIterator first, // freestanding InputIterator last, NoThrowForwardIterator result); template NoThrowForwardIterator uninitialized_copy(ExecutionPolicy&& exec, // freestanding-deleted, ForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") ForwardIterator last, NoThrowForwardIterator result); templateconstexpr NoThrowForwardIterator uninitialized_copy_n(InputIterator first, // freestanding Size n, NoThrowForwardIterator result); template NoThrowForwardIterator uninitialized_copy_n(ExecutionPolicy&& exec, // freestanding-deleted, ForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") Size n, NoThrowForwardIterator result); namespace ranges {templateusing [uninitialized_copy_result](#lib:uninitialized_copy_result "20.2.2 Header synopsis [memory.syn]") = in_out_result; // freestandingtemplate<[input_iterator](iterator.concept.input#concept:input_iterator "24.3.4.9 Concept input_­iterator [iterator.concept.input]") I, [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]") S1, [*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") O, [*nothrow-sentinel-for*](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S2>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), iter_reference_t>constexpr uninitialized_copy_result uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast); // freestandingtemplate<[input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]") IR, [*nothrow-forward-range*](special.mem.concepts#concept:nothrow-forward-range "26.11.2 Special memory concepts [special.mem.concepts]") OR>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), range_reference_t>constexpr uninitialized_copy_result, borrowed_iterator_t> uninitialized_copy(IR&& in_range, OR&& out_range); // freestandingtemplateusing [uninitialized_copy_n_result](#lib:uninitialized_copy_n_result "20.2.2 Header synopsis [memory.syn]") = in_out_result; // freestandingtemplate<[input_iterator](iterator.concept.input#concept:input_iterator "24.3.4.9 Concept input_­iterator [iterator.concept.input]") I, [*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") O, [*nothrow-sentinel-for*](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), iter_reference_t>constexpr uninitialized_copy_n_result uninitialized_copy_n(I ifirst, iter_difference_t n, // freestanding O ofirst, S olast); template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [random_access_iterator](iterator.concept.random.access#concept:random_access_iterator "24.3.4.13 Concept random_­access_­iterator [iterator.concept.random.access]") I, [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]") S1, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") O, [*nothrow-sized-sentinel-for*](special.mem.concepts#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S2>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), iter_reference_t> uninitialized_copy_result uninitialized_copy(Ep&& exec, I ifirst, S1 ilast, // freestanding-deleted, O ofirst, S2 olast); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*sized-random-access-range*](range.refinements#concept:sized-random-access-range "25.4.6 Other range refinements [range.refinements]") IR, [*nothrow-sized-random-access-range*](special.mem.concepts#concept:nothrow-sized-random-access-range "26.11.2 Special memory concepts [special.mem.concepts]") OR>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), range_reference_t> uninitialized_copy_result, borrowed_iterator_t> uninitialized_copy(Ep&& exec, IR&& in_range, OR&& out_range); // freestanding-deleted,// see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [random_access_iterator](iterator.concept.random.access#concept:random_access_iterator "24.3.4.13 Concept random_­access_­iterator [iterator.concept.random.access]") I, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") O, [*nothrow-sized-sentinel-for*](special.mem.concepts#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), iter_reference_t> uninitialized_copy_n_result uninitialized_copy_n(Ep&& exec, I ifirst, iter_difference_t n, // freestanding-deleted, O ofirst, S olast); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")}templateconstexpr NoThrowForwardIterator uninitialized_move(InputIterator first, // freestanding InputIterator last, NoThrowForwardIterator result); template NoThrowForwardIterator uninitialized_move(ExecutionPolicy&& exec, // freestanding-deleted, ForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") ForwardIterator last, NoThrowForwardIterator result); templateconstexpr pair uninitialized_move_n(InputIterator first, Size n, // freestanding NoThrowForwardIterator result); template pair uninitialized_move_n(ExecutionPolicy&& exec, // freestanding-deleted, ForwardIterator first, Size n, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") NoThrowForwardIterator result); namespace ranges {templateusing [uninitialized_move_result](#lib:uninitialized_move_result "20.2.2 Header synopsis [memory.syn]") = in_out_result; // freestandingtemplate<[input_iterator](iterator.concept.input#concept:input_iterator "24.3.4.9 Concept input_­iterator [iterator.concept.input]") I, [sentinel_for](iterator.concept.sentinel#concept:sentinel_for "24.3.4.7 Concept sentinel_­for [iterator.concept.sentinel]") S1, [*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") O, [*nothrow-sentinel-for*](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S2>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), iter_rvalue_reference_t>constexpr uninitialized_move_result uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); // freestandingtemplate<[input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]") IR, [*nothrow-forward-range*](special.mem.concepts#concept:nothrow-forward-range "26.11.2 Special memory concepts [special.mem.concepts]") OR>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), range_rvalue_reference_t>constexpr uninitialized_move_result, borrowed_iterator_t> uninitialized_move(IR&& in_range, OR&& out_range); // freestandingtemplateusing [uninitialized_move_n_result](#lib:uninitialized_move_n_result "20.2.2 Header synopsis [memory.syn]") = in_out_result; // freestandingtemplate<[input_iterator](iterator.concept.input#concept:input_iterator "24.3.4.9 Concept input_­iterator [iterator.concept.input]") I, [*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") O, [*nothrow-sentinel-for*](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), iter_rvalue_reference_t>constexpr uninitialized_move_n_result uninitialized_move_n(I ifirst, iter_difference_t n, // freestanding O ofirst, S olast); template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [random_access_iterator](iterator.concept.random.access#concept:random_access_iterator "24.3.4.13 Concept random_­access_­iterator [iterator.concept.random.access]") I, [sized_sentinel_for](iterator.concept.sizedsentinel#concept:sized_sentinel_for "24.3.4.8 Concept sized_­sentinel_­for [iterator.concept.sizedsentinel]") S1, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") O, [*nothrow-sized-sentinel-for*](special.mem.concepts#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S2>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), iter_rvalue_reference_t> uninitialized_move_result uninitialized_move(Ep&& exec, I ifirst, S1 ilast, // freestanding-deleted, O ofirst, S2 olast); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*sized-random-access-range*](range.refinements#concept:sized-random-access-range "25.4.6 Other range refinements [range.refinements]") IR, [*nothrow-sized-random-access-range*](special.mem.concepts#concept:nothrow-sized-random-access-range "26.11.2 Special memory concepts [special.mem.concepts]") OR>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), range_rvalue_reference_t> uninitialized_move_result, borrowed_iterator_t> uninitialized_move(Ep&& exec, IR&& in_range, OR&& out_range); // freestanding-deleted,// see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [random_access_iterator](iterator.concept.random.access#concept:random_access_iterator "24.3.4.13 Concept random_­access_­iterator [iterator.concept.random.access]") I, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") O, [*nothrow-sized-sentinel-for*](special.mem.concepts#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), iter_rvalue_reference_t> uninitialized_move_n_result uninitialized_move_n(Ep&& exec, I ifirst, iter_difference_t n, // freestanding-deleted, O ofirst, S olast); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")}templateconstexpr void uninitialized_fill(NoThrowForwardIterator first, // freestanding NoThrowForwardIterator last, const T& x); templatevoid uninitialized_fill(ExecutionPolicy&& exec, // freestanding-deleted, NoThrowForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") NoThrowForwardIterator last, const T& x); templateconstexpr NoThrowForwardIterator uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T& x); // freestandingtemplate NoThrowForwardIterator uninitialized_fill_n(ExecutionPolicy&& exec, // freestanding-deleted, NoThrowForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") Size n, const T& x); namespace ranges {template<[*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, [*nothrow-sentinel-for*](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S, class T>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), const T&>constexpr I uninitialized_fill(I first, S last, const T& x); // freestandingtemplate<[*nothrow-forward-range*](special.mem.concepts#concept:nothrow-forward-range "26.11.2 Special memory concepts [special.mem.concepts]") R, class T>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), const T&>constexpr borrowed_iterator_t uninitialized_fill(R&& r, const T& x); // freestandingtemplate<[*nothrow-forward-iterator*](special.mem.concepts#concept:nothrow-forward-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, class T>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), const T&>constexpr I uninitialized_fill_n(I first, // freestanding iter_difference_t n, const T& x); template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, [*nothrow-sized-sentinel-for*](special.mem.concepts#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S, class T>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), const T&> I uninitialized_fill(Ep&& exec, I first, S last, const T& x); // freestanding-deleted,// see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-sized-random-access-range*](special.mem.concepts#concept:nothrow-sized-random-access-range "26.11.2 Special memory concepts [special.mem.concepts]") R, class T>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), const T&> borrowed_iterator_t uninitialized_fill(Ep&& exec, R&& r, // freestanding-deleted,const T& x); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, class T>requires [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_­from [concept.constructible]"), const T&> I uninitialized_fill_n(Ep&& exec, I first, // freestanding-deleted, iter_difference_t n, const T& x); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")}// [[specialized.construct]](specialized.construct "26.11.8 construct_­at"), construct_attemplateconstexpr T* construct_at(T* location, Args&&... args); // freestandingnamespace ranges {templateconstexpr T* construct_at(T* location, Args&&... args); // freestanding}// [[specialized.destroy]](specialized.destroy "26.11.9 destroy"), destroytemplateconstexpr void destroy_at(T* location); // freestandingtemplateconstexpr void destroy(NoThrowForwardIterator first, // freestanding NoThrowForwardIterator last); templatevoid destroy(ExecutionPolicy&& exec, // freestanding-deleted, NoThrowForwardIterator first, // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads") NoThrowForwardIterator last); templateconstexpr NoThrowForwardIterator destroy_n(NoThrowForwardIterator first, // freestanding Size n); template NoThrowForwardIterator destroy_n(ExecutionPolicy&& exec, // freestanding-deleted, NoThrowForwardIterator first, Size n); // see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")namespace ranges {template<[destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]") T>constexpr void destroy_at(T* location) noexcept; // freestandingtemplate<[*nothrow-input-iterator*](special.mem.concepts#concept:nothrow-input-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, [*nothrow-sentinel-for*](special.mem.concepts#concept:nothrow-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]")>constexpr I destroy(I first, S last) noexcept; // freestandingtemplate<[*nothrow-input-range*](special.mem.concepts#concept:nothrow-input-range "26.11.2 Special memory concepts [special.mem.concepts]") R>requires [destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]")>constexpr borrowed_iterator_t destroy(R&& r) noexcept; // freestandingtemplate<[*nothrow-input-iterator*](special.mem.concepts#concept:nothrow-input-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I>requires [destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]")>constexpr I destroy_n(I first, iter_difference_t n) noexcept; // freestandingtemplate<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I, [*nothrow-sized-sentinel-for*](special.mem.concepts#concept:nothrow-sized-sentinel-for "26.11.2 Special memory concepts [special.mem.concepts]") S>requires [destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]")> I destroy(Ep&& exec, I first, S last) noexcept; // freestanding-deleted,// see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-sized-random-access-range*](special.mem.concepts#concept:nothrow-sized-random-access-range "26.11.2 Special memory concepts [special.mem.concepts]") R>requires [destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]")> borrowed_iterator_t destroy(Ep&& exec, R&& r) noexcept; // freestanding-deleted,// see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")template<[*execution-policy*](algorithms.parallel.defns#concept:execution-policy "26.3.1 Preamble [algorithms.parallel.defns]") Ep, [*nothrow-random-access-iterator*](special.mem.concepts#concept:nothrow-random-access-iterator "26.11.2 Special memory concepts [special.mem.concepts]") I>requires [destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]")> I destroy_n(Ep&& exec, I first, iter_difference_t n) noexcept; // freestanding-deleted,// see [[algorithms.parallel.overloads]](algorithms.parallel.overloads "26.3.5 Parallel algorithm overloads")}// [[unique.ptr]](unique.ptr "20.3.1 Unique-ownership pointers"), class template unique_ptrtemplate struct default_delete; // freestandingtemplate struct default_delete; // freestandingtemplate> class unique_ptr; // freestandingtemplate class unique_ptr; // freestandingtemplateconstexpr unique_ptr make_unique(Args&&... args); // T is not arraytemplateconstexpr unique_ptr make_unique(size_t n); // T is U[]template*unspecified* make_unique(Args&&...) = delete; // T is U[N]templateconstexpr unique_ptr make_unique_for_overwrite(); // T is not arraytemplateconstexpr unique_ptr make_unique_for_overwrite(size_t n); // T is U[]template*unspecified* make_unique_for_overwrite(Args&&...) = delete; // T is U[N]templateconstexpr void swap(unique_ptr& x, unique_ptr& y) noexcept; // freestandingtemplateconstexpr bool operator==(const unique_ptr& x, // freestandingconst unique_ptr& y); templateconstexpr bool operator<(const unique_ptr& x, // freestandingconst unique_ptr& y); templateconstexpr bool operator>(const unique_ptr& x, // freestandingconst unique_ptr& y); templateconstexpr bool operator<=(const unique_ptr& x, // freestandingconst unique_ptr& y); templateconstexpr bool operator>=(const unique_ptr& x, // freestandingconst unique_ptr& y); templaterequires [three_way_comparable_with](cmp.concept#concept:three_way_comparable_with "17.12.4 Concept three_­way_­comparable [cmp.concept]")::pointer, typename unique_ptr::pointer>constexpr compare_three_way_result_t::pointer, typename unique_ptr::pointer>operator<=>(const unique_ptr& x, const unique_ptr& y); // freestandingtemplateconstexpr bool operator==(const unique_ptr& x, nullptr_t) noexcept; // freestandingtemplateconstexpr bool operator<(const unique_ptr& x, nullptr_t); // freestandingtemplateconstexpr bool operator<(nullptr_t, const unique_ptr& y); // freestandingtemplateconstexpr bool operator>(const unique_ptr& x, nullptr_t); // freestandingtemplateconstexpr bool operator>(nullptr_t, const unique_ptr& y); // freestandingtemplateconstexpr bool operator<=(const unique_ptr& x, nullptr_t); // freestandingtemplateconstexpr bool operator<=(nullptr_t, const unique_ptr& y); // freestandingtemplateconstexpr bool operator>=(const unique_ptr& x, nullptr_t); // freestandingtemplateconstexpr bool operator>=(nullptr_t, const unique_ptr& y); // freestandingtemplaterequires [three_way_comparable](cmp.concept#concept:three_way_comparable "17.12.4 Concept three_­way_­comparable [cmp.concept]")::pointer>constexpr compare_three_way_result_t::pointer>operator<=>(const unique_ptr& x, nullptr_t); // freestandingtemplate basic_ostream& operator<<(basic_ostream& os, const unique_ptr& p); // [[util.smartptr.weak.bad]](util.smartptr.weak.bad "20.3.2.1 Class bad_­weak_­ptr"), class bad_weak_ptrclass bad_weak_ptr; // [[util.smartptr.shared]](util.smartptr.shared "20.3.2.2 Class template shared_­ptr"), class template shared_ptrtemplate class shared_ptr; // [[util.smartptr.shared.create]](util.smartptr.shared.create "20.3.2.2.7 Creation"), shared_ptr creationtemplateconstexpr shared_ptr make_shared(Args&&... args); // T is not arraytemplateconstexpr shared_ptr allocate_shared(const A& a, Args&&... args); // T is not arraytemplateconstexpr shared_ptr make_shared(size_t N); // T is U[]templateconstexpr shared_ptr allocate_shared(const A& a, size_t N); // T is U[]templateconstexpr shared_ptr make_shared(); // T is U[N]templateconstexpr shared_ptr allocate_shared(const A& a); // T is U[N]templateconstexpr shared_ptr make_shared(size_t N, const remove_extent_t& u); // T is U[]templateconstexpr shared_ptr allocate_shared(const A& a, size_t N, const remove_extent_t& u); // T is U[]templateconstexpr shared_ptr make_shared(const remove_extent_t& u); // T is U[N]templateconstexpr shared_ptr allocate_shared(const A& a, // T is U[N]const remove_extent_t& u); templateconstexpr shared_ptr make_shared_for_overwrite(); // T is not U[]templateconstexpr shared_ptr allocate_shared_for_overwrite(const A& a); // T is not U[]templateconstexpr shared_ptr make_shared_for_overwrite(size_t N); // T is U[]templateconstexpr shared_ptr allocate_shared_for_overwrite(const A& a, size_t N); // T is U[]// [[util.smartptr.shared.cmp]](util.smartptr.shared.cmp "20.3.2.2.8 Comparison"), shared_ptr comparisonstemplateconstexpr bool operator==(const shared_ptr& a, const shared_ptr& b) noexcept; templateconstexpr strong_ordering operator<=>(const shared_ptr& a, const shared_ptr& b) noexcept; templateconstexpr bool operator==(const shared_ptr& x, nullptr_t) noexcept; templateconstexpr strong_ordering operator<=>(const shared_ptr& x, nullptr_t) noexcept; // [[util.smartptr.shared.spec]](util.smartptr.shared.spec "20.3.2.2.9 Specialized algorithms"), shared_ptr specialized algorithmstemplateconstexpr void swap(shared_ptr& a, shared_ptr& b) noexcept; // [[util.smartptr.shared.cast]](util.smartptr.shared.cast "20.3.2.2.10 Casts"), shared_ptr caststemplateconstexpr shared_ptr static_pointer_cast(const shared_ptr& r) noexcept; templateconstexpr shared_ptr static_pointer_cast(shared_ptr&& r) noexcept; templateconstexpr shared_ptr dynamic_pointer_cast(const shared_ptr& r) noexcept; templateconstexpr shared_ptr dynamic_pointer_cast(shared_ptr&& r) noexcept; templateconstexpr shared_ptr const_pointer_cast(const shared_ptr& r) noexcept; templateconstexpr shared_ptr const_pointer_cast(shared_ptr&& r) noexcept; template shared_ptr reinterpret_pointer_cast(const shared_ptr& r) noexcept; template shared_ptr reinterpret_pointer_cast(shared_ptr&& r) noexcept; // [[util.smartptr.getdeleter]](util.smartptr.getdeleter "20.3.2.2.11 get_­deleter"), shared_ptr get_deletertemplateconstexpr D* get_deleter(const shared_ptr& p) noexcept; // [[util.smartptr.shared.io]](util.smartptr.shared.io "20.3.2.2.12 I/O"), shared_ptr I/Otemplate basic_ostream& operator<<(basic_ostream& os, const shared_ptr& p); // [[util.smartptr.weak]](util.smartptr.weak "20.3.2.3 Class template weak_­ptr"), class template weak_ptrtemplate class weak_ptr; // [[util.smartptr.weak.spec]](util.smartptr.weak.spec "20.3.2.3.7 Specialized algorithms"), weak_ptr specialized algorithmstemplate constexpr void swap(weak_ptr& a, weak_ptr& b) noexcept; // [[util.smartptr.ownerless]](util.smartptr.ownerless "20.3.2.4 Class template owner_­less"), class template owner_lesstemplate struct owner_less; // [[util.smartptr.owner.hash]](util.smartptr.owner.hash "20.3.2.5 Struct owner_­hash"), struct owner_hashstruct owner_hash; // [[util.smartptr.owner.equal]](util.smartptr.owner.equal "20.3.2.6 Struct owner_­equal"), struct owner_equalstruct owner_equal; // [[util.smartptr.enab]](util.smartptr.enab "20.3.2.7 Class template enable_­shared_­from_­this"), class template enable_shared_from_thistemplate class enable_shared_from_this; // [[util.smartptr.hash]](util.smartptr.hash "20.3.3 Smart pointer hash support"), hash supporttemplate struct hash; // freestandingtemplate struct hash>; // freestandingtemplate struct hash>; // [[util.smartptr.atomic]](util.smartptr.atomic "32.5.8.7 Partial specializations for smart pointers"), atomic smart pointerstemplate struct atomic; // freestandingtemplate struct atomic>; template struct atomic>; // [[out.ptr.t]](out.ptr.t "20.3.4.1 Class template out_­ptr_­t"), class template out_ptr_ttemplateclass out_ptr_t; // freestanding// [[out.ptr]](out.ptr "20.3.4.2 Function template out_­ptr"), function template out_ptrtemplateconstexpr auto out_ptr(Smart& s, Args&&... args); // freestanding// [[inout.ptr.t]](inout.ptr.t "20.3.4.3 Class template inout_­ptr_­t"), class template inout_ptr_ttemplateclass inout_ptr_t; // freestanding// [[inout.ptr]](inout.ptr "20.3.4.4 Function template inout_­ptr"), function template inout_ptrtemplateconstexpr auto inout_ptr(Smart& s, Args&&... args); // freestanding// [[indirect]](indirect "20.4.1 Class template indirect"), class template indirecttemplate>class indirect; // [[indirect.hash]](indirect.hash "20.4.1.10 Hash support"), hash supporttemplate struct hash>; // [[polymorphic]](polymorphic "20.4.2 Class template polymorphic"), class template polymorphictemplate>class polymorphic; namespace pmr {template using indirect = indirect>; template using polymorphic = polymorphic>; }}