Standard library header <memory> - cppreference.com

#include<compare>namespacestd{// pointer Traitstemplate<classPtr>structpointer_traits;// freestandingtemplate<classT>structpointer_traits<T*>;// freestanding// pointer conversiontemplate<classT>constexprT*to_address(T*p)noexcept;// freestandingtemplate<classPtr>constexprautoto_address(constPtr&p)noexcept;// freestanding// pointer alignmentvoid*align(size_talignment,size_tsize,void*&ptr,size_t&space);// freestandingtemplate<size_tN,classT>constexprT*assume_aligned(T*ptr);// freestandingtemplate<size_tAlignment,classT>boolis_sufficiently_aligned(T*ptr);// explicit lifetime managementtemplate<classT>T*start_lifetime_as(void*p)noexcept;// freestandingtemplate<classT>constT*start_lifetime_as(constvoid*p)noexcept;// freestandingtemplate<classT>volatileT*start_lifetime_as(volatilevoid*p)noexcept;// freestandingtemplate<classT>constvolatileT*start_lifetime_as(constvolatilevoid*p)noexcept;// freestandingtemplate<classT>T*start_lifetime_as_array(void*p,size_tn)noexcept;// freestandingtemplate<classT>constT*start_lifetime_as_array(constvoid*p,size_tn)noexcept;// freestandingtemplate<classT>volatileT*start_lifetime_as_array(volatilevoid*p,size_tn)noexcept;// freestandingtemplate<classT>constvolatileT*start_lifetime_as_array(constvolatilevoid*p,// freestandingsize_tn)noexcept;template<classT>T*trivially_relocate(T*first,T*last,T*result);// freestandingtemplate<classT>constexprT*relocate(T*first,T*last,T*result);// freestanding// allocator argument tagstructallocator_arg_t{explicitallocator_arg_t()=default;};// freestandinginlineconstexprallocator_arg_tallocator_arg{};// freestanding// uses_allocatortemplate<classT,classAlloc>structuses_allocator;// freestanding// uses_allocatortemplate<classT,classAlloc>constexprbooluses_allocator_v=uses_allocator<T,Alloc>::value;// freestanding// uses-allocator constructiontemplate<classT,classAlloc,class...Args>constexprautouses_allocator_construction_args(constAlloc&alloc,// freestandingArgs&&...args)noexcept;template<classT,classAlloc,classTuple1,classTuple2>constexprautouses_allocator_construction_args(constAlloc&alloc,// freestandingpiecewise_construct_t,Tuple1&&x,Tuple2&&y)noexcept;template<classT,classAlloc>constexprautouses_allocator_construction_args(constAlloc&alloc)noexcept;// freestandingtemplate<classT,classAlloc,classU,classV>constexprautouses_allocator_construction_args(constAlloc&alloc,// freestandingU&&u,V&&v)noexcept;template<classT,classAlloc,classU,classV>constexprautouses_allocator_construction_args(constAlloc&alloc,// freestandingpair<U,V>&pr)noexcept;template<classT,classAlloc,classU,classV>constexprautouses_allocator_construction_args(constAlloc&alloc,// freestandingconstpair<U,V>&pr)noexcept;template<classT,classAlloc,classU,classV>constexprautouses_allocator_construction_args(constAlloc&alloc,// freestandingpair<U,V>&&pr)noexcept;template<classT,classAlloc,classU,classV>constexprautouses_allocator_construction_args(constAlloc&alloc,// freestandingconstpair<U,V>&&pr)noexcept;template<classT,classAlloc,/*pair-like*/P>constexprautouses_allocator_construction_args(constAlloc&alloc,// freestandingP&&p)noexcept;template<classT,classAlloc,classU>constexprautouses_allocator_construction_args(constAlloc&alloc,// freestandingU&&u)noexcept;template<classT,classAlloc,class...Args>constexprTmake_obj_using_allocator(constAlloc&alloc,Args&&...args);// freestandingtemplate<classT,classAlloc,class...Args>constexprT*uninitialized_construct_using_allocator(T*p,// freestandingconstAlloc&alloc,Args&&...args);// allocator Traitstemplate<classAlloc>structallocator_traits;// freestandingtemplate<classPointer,classSizeType=size_t>structallocation_result{// freestandingPointerptr;SizeTypecount;};// the default allocatortemplate<classT>classallocator;template<classT,classU>constexprbooloperator==(constallocator<T>&,constallocator<U>&)noexcept;// addressoftemplate<classT>constexprT*addressof(T&r)noexcept;// freestandingtemplate<classT>constT*addressof(constT&&)=delete;// freestanding// specialized algorithms// special memory conceptstemplate<classI>conceptnothrow-input-iterator=/* see description */;// exposition-onlytemplate<classI>conceptnothrow-forward-iterator=/* see description */;// exposition-onlytemplate<classI>conceptnothrow-bidirectional-iterator=/* see description */;// exposition-onlytemplate<classI>conceptnothrow-random-access-iterator=/* see description */;// exposition-onlytemplate<classS,classI>conceptnothrow-sentinel-for=/* see description */;// exposition-onlytemplate<classS,classI>conceptnothrow-sized-sentinel-for=/* see description */;// exposition-onlytemplate<classR>conceptnothrow-input-range=/* see description */;// exposition-onlytemplate<classR>conceptnothrow-forward-range=/* see description */;// exposition-onlytemplate<classR>conceptnothrow-bidirectional-range=/* see description */;// exposition-onlytemplate<classR>conceptnothrow-random-access-range=/* see description */;// exposition-onlytemplate<classR>conceptnothrow-sized-random-access-range=/* see description */;// exposition-onlytemplate<classNoThrowForwardIter>constexprvoiduninitialized_default_construct(NoThrowForwardIterfirst,// freestandingNoThrowForwardIterlast);template<classExecutionPolicy,classNoThrowForwardIter>voiduninitialized_default_construct(ExecutionPolicy&&exec,// freestanding-deletedNoThrowForwardIterfirst,NoThrowForwardIterlast);template<classNoThrowForwardIter,classSize>constexprNoThrowForwardIteruninitialized_default_construct_n(NoThrowForwardIterfirst,Sizen);// freestandingtemplate<classExecutionPolicy,classNoThrowForwardIter,classSize>NoThrowForwardIteruninitialized_default_construct_n(ExecutionPolicy&&exec,// freestanding-deletedNoThrowForwardIterfirst,Sizen);namespaceranges{template<no-throw-forward-iteratorI,no-throw-sentinel-for<I>S>requiresdefault_initializable<iter_value_t<I>>constexprIuninitialized_default_construct(Ifirst,Slast);// freestandingtemplate<no-throw-forward-rangeR>requiresdefault_initializable<range_value_t<R>>constexprborrowed_iterator_t<R>uninitialized_default_construct(R&&r);// freestandingtemplate<no-throw-forward-iteratorI>requiresdefault_initializable<iter_value_t<I>>constexprIuninitialized_default_construct_n(Ifirst,// freestandingiter_difference_t<I>n);template<execution-policyEp,nothrow-random-access-iteratorI,nothrow-sized-sentinel-for<I>S>requiresdefault_initializable<iter_value_t<I>>Iuninitialized_default_construct(Ep&&exec,Ifirst,Slast);// freestanding-deletedtemplate<execution-policyEp,nothrow-sized-random-access-rangeR>requiresdefault_initializable<range_value_t<R>>borrowed_iterator_t<R>uninitialized_default_construct// freestanding-deleted(Ep&&exec,R&&r);template<execution-policyEp,nothrow-random-access-iteratorI>requiresdefault_initializable<iter_value_t<I>>Iuninitialized_default_construct_n(Ep&&exec,Ifirst,// freestanding-deletediter_difference_t<I>n);}template<classNoThrowForwardIter>constexprvoiduninitialized_value_construct(NoThrowForwardIterfirst,// freestandingNoThrowForwardIterlast);template<classExecutionPolicy,classNoThrowForwardIter>voiduninitialized_value_construct(ExecutionPolicy&&exec,// freestanding-deletedNoThrowForwardIterfirst,NoThrowForwardIterlast);template<classNoThrowForwardIter,classSize>constexprNoThrowForwardIteruninitialized_value_construct_n(NoThrowForwardIterfirst,Sizen);// freestandingtemplate<classExecutionPolicy,classNoThrowForwardIter,classSize>NoThrowForwardIteruninitialized_value_construct_n(ExecutionPolicy&&exec,// freestanding-deletedNoThrowForwardIterfirst,Sizen);namespaceranges{template<no-throw-forward-iteratorI,no-throw-sentinel-for<I>S>requiresdefault_initializable<iter_value_t<I>>constexprIuninitialized_value_construct(Ifirst,Slast);// freestandingtemplate<no-throw-forward-rangeR>requiresdefault_initializable<range_value_t<R>>constexprborrowed_iterator_t<R>uninitialized_value_construct(R&&r);// freestandingtemplate<no-throw-forward-iteratorI>requiresdefault_initializable<iter_value_t<I>>constexprIuninitialized_value_construct_n(Ifirst,// freestandingiter_difference_t<I>n);template<execution-policyEp,nothrow-random-access-iteratorI,nothrow-sized-sentinel-for<I>S>requiresdefault_initializable<iter_value_t<I>>Iuninitialized_value_construct(Ep&&exec,Ifirst,Slast);// freestanding-deletedtemplate<execution-policyEp,nothrow-sized-random-access-rangeR>requiresdefault_initializable<range_value_t<R>>borrowed_iterator_t<R>uninitialized_value_construct// freestanding-deleted(Ep&&exec,R&&r);template<execution-policyEp,nothrow-random-access-iteratorI>requiresdefault_initializable<iter_value_t<I>>Iuninitialized_value_construct_n(Ep&&exec,Ifirst,// freestanding-deletediter_difference_t<I>n);}template<classInputIter,classNoThrowForwardIter>constexprNoThrowForwardIteruninitialized_copy(InputIterfirst,// freestandingInputIterlast,NoThrowForwardIterresult);template<classExecutionPolicy,classForwardIter,classNoThrowForwardIter>NoThrowForwardIteruninitialized_copy(ExecutionPolicy&&exec,// freestanding-deletedForwardIterfirst,ForwardIterlast,NoThrowForwardIterresult);template<classInputIter,classSize,classNoThrowForwardIter>constexprNoThrowForwardIteruninitialized_copy_n(InputIterfirst,// freestandingSizen,NoThrowForwardIterresult);template<classExecutionPolicy,classForwardIter,classSize,classNoThrowForwardIter>NoThrowForwardIteruninitialized_copy_n(ExecutionPolicy&&exec,// freestanding-deletedForwardIterfirst,Sizen,NoThrowForwardIterresult);namespaceranges{template<classI,classO>usinguninitialized_copy_result=in_out_result<I,O>;// freestandingtemplate<input_iteratorI,sentinel_for<I>S1,no-throw-forward-iteratorO,no-throw-sentinel-for<O>S2>requiresconstructible_from<iter_value_t<O>,iter_reference_t<I>>constexpruninitialized_copy_result<I,O>uninitialized_copy(Iifirst,S1ilast,Oofirst,S2olast);// freestandingtemplate<input_rangeIR,no-throw-forward-rangeOR>requiresconstructible_from<range_value_t<OR>,range_reference_t<IR>>constexpruninitialized_copy_result<borrowed_iterator_t<IR>,borrowed_iterator_t<OR>>uninitialized_copy(IR&&in_range,OR&&out_range);// freestandingtemplate<classI,classO>usinguninitialized_copy_n_result=in_out_result<I,O>;// freestandingtemplate<input_iteratorI,no-throw-forward-iteratorO,no-throw-sentinel-for<O>S>requiresconstructible_from<iter_value_t<O>,iter_reference_t<I>>constexpruninitialized_copy_n_result<I,O>uninitialized_copy_n(Iifirst,iter_difference_t<I>n,// freestandingOofirst,Solast);template<execution-policyEp,random_access_iteratorI,sized_sentinel_for<I>S1,nothrow-random-access-iteratorO,nothrow-sized-sentinel-for<O>S2>requiresconstructible_from<iter_value_t<O>,iter_reference_t<I>>uninitialized_copy_result<I,O>uninitialized_copy(Ep&&exec,Iifirst,S1ilast,// freestanding-deletedOofirst,S2olast);template<execution-policyEp,sized-random-access-rangeIR,nothrow-sized-random-access-rangeOR>requiresconstructible_from<range_value_t<OR>,range_reference_t<IR>>uninitialized_copy_result<borrowed_iterator_t<IR>,borrowed_iterator_t<OR>>uninitialized_copy(Ep&&exec,IR&&in_range,OR&&out_range);// freestanding-deletedtemplate<execution-policyEp,random_access_iteratorI,nothrow-random-access-iteratorO,nothrow-sized-sentinel-for<O>S>requiresconstructible_from<iter_value_t<O>,iter_reference_t<I>>uninitialized_copy_n_result<I,O>uninitialized_copy_n(Ep&&exec,Iifirst,// freestanding-deletediter_difference_t<I>n,Oofirst,Solast);}template<classInputIter,classNoThrowForwardIter>constexprNoThrowForwardIteruninitialized_move(InputIterfirst,// freestandingInputIterlast,NoThrowForwardIterresult);template<classExecutionPolicy,classForwardIter,classNoThrowForwardIter>NoThrowForwardIteruninitialized_move(ExecutionPolicy&&exec,// freestanding-deletedForwardIterfirst,ForwardIterlast,NoThrowForwardIterresult);template<classInputIter,classSize,classNoThrowForwardIter>constexprpair<InputIter,NoThrowForwardIter>uninitialized_move_n(InputIterfirst,Sizen,// freestandingNoThrowForwardIterresult);template<classExecutionPolicy,classForwardIter,classSize,classNoThrowForwardIter>pair<ForwardIter,NoThrowForwardIter>uninitialized_move_n(ExecutionPolicy&&exec,// freestanding-deletedForwardIterfirst,Sizen,NoThrowForwardIterresult);namespaceranges{template<classI,classO>usinguninitialized_move_result=in_out_result<I,O>;// freestandingtemplate<input_iteratorI,sentinel_for<I>S1,no-throw-forward-iteratorO,no-throw-sentinel-for<O>S2>requiresconstructible_from<iter_value_t<O>,iter_rvalue_reference_t<I>>constexpruninitialized_move_result<I,O>uninitialized_move(Iifirst,S1ilast,Oofirst,S2olast);// freestandingtemplate<input_rangeIR,no-throw-forward-rangeOR>requiresconstructible_from<range_value_t<OR>,range_rvalue_reference_t<IR>>constexpruninitialized_move_result<borrowed_iterator_t<IR>,borrowed_iterator_t<OR>>uninitialized_move(IR&&in_range,OR&&out_range);// freestandingtemplate<classI,classO>usinguninitialized_move_n_result=in_out_result<I,O>;// freestandingtemplate<input_iteratorI,no-throw-forward-iteratorO,no-throw-sentinel-for<O>S>requiresconstructible_from<iter_value_t<O>,iter_rvalue_reference_t<I>>constexpruninitialized_move_n_result<I,O>uninitialized_move_n(Iifirst,iter_difference_t<I>n,// freestandingOofirst,Solast);template<execution-policyEp,random_access_iteratorI,sized_sentinel_for<I>S1,nothrow-random-access-iteratorO,nothrow-sized-sentinel-for<O>S2>requiresconstructible_from<iter_value_t<O>,iter_rvalue_reference_t<I>>uninitialized_move_result<I,O>uninitialized_move(Ep&&exec,Iifirst,S1ilast,// freestanding-deletedOofirst,S2olast);template<execution-policyEp,sized-random-access-rangeIR,nothrow-sized-random-access-rangeOR>requiresconstructible_from<range_value_t<OR>,range_rvalue_reference_t<IR>>uninitialized_move_result<borrowed_iterator_t<IR>,borrowed_iterator_t<OR>>uninitialized_move(Ep&&exec,IR&&in_range,OR&&out_range);// freestanding-deletedtemplate<execution-policyEp,random_access_iteratorI,nothrow-random-access-iteratorO,nothrow-sized-sentinel-for<O>S>requiresconstructible_from<iter_value_t<O>,iter_rvalue_reference_t<I>>uninitialized_move_n_result<I,O>uninitialized_move_n(Ep&&exec,Iifirst,// freestanding-deletediter_difference_t<I>n,Oofirst,Solast);}template<classNoThrowForwardIter,classT>constexprvoiduninitialized_fill(NoThrowForwardIterfirst,// freestandingNoThrowForwardIterlast,constT&x);template<classExecutionPolicy,classNoThrowForwardIter,classT>voiduninitialized_fill(ExecutionPolicy&&exec,// freestanding-deletedNoThrowForwardIterfirst,NoThrowForwardIterlast,constT&x);template<classNoThrowForwardIter,classSize,classT>constexprNoThrowForwardIteruninitialized_fill_n(NoThrowForwardIterfirst,Sizen,constT&x);// freestandingtemplate<classExecutionPolicy,classNoThrowForwardIter,classSize,classT>NoThrowForwardIteruninitialized_fill_n(ExecutionPolicy&&exec,// freestanding-deletedNoThrowForwardIterfirst,Sizen,constT&x);namespaceranges{template<no-throw-forward-iteratorI,no-throw-sentinel-for<I>S,classT>requiresconstructible_from<iter_value_t<I>,constT&>constexprIuninitialized_fill(Ifirst,Slast,constT&x);// freestandingtemplate<no-throw-forward-rangeR,classT>requiresconstructible_from<range_value_t<R>,constT&>constexprborrowed_iterator_t<R>uninitialized_fill(R&&r,constT&x);// freestandingtemplate<no-throw-forward-iteratorI,classT>requiresconstructible_from<iter_value_t<I>,constT&>constexprIuninitialized_fill_n(Ifirst,// freestandingiter_difference_t<I>n,constT&x);template<execution-policyEp,nothrow-random-access-iteratorI,nothrow-sized-sentinel-for<I>S,classT=iter_value_t<I>>requiresconstructible_from<iter_value_t<I>,constT&>Iuninitialized_fill(Ep&&exec,Ifirst,Slast,constT&x);// freestanding-deletedtemplate<execution-policyEp,nothrow-sized-random-access-rangeR,classT=range_value_t<R>>requiresconstructible_from<range_value_t<R>,constT&>borrowed_iterator_t<R>uninitialized_fill(Ep&&exec,R&&r,// freestanding-deletedconstT&x);template<execution-policyEp,nothrow-random-access-iteratorI,classT=iter_value_t<I>>requiresconstructible_from<iter_value_t<I>,constT&>Iuninitialized_fill_n(Ep&&exec,Ifirst,// freestanding-deletediter_difference_t<I>n,constT&x);}// construct_attemplate<classT,class...Args>constexprT*construct_at(T*location,Args&&...args);// freestandingnamespaceranges{template<classT,class...Args>constexprT*construct_at(T*location,Args&&...args);// freestanding}// destroytemplate<classT>constexprvoiddestroy_at(T*location);// freestandingtemplate<classNoThrowForwardIter>constexprvoiddestroy(NoThrowForwardIterfirst,// freestandingNoThrowForwardIterlast);template<classExecutionPolicy,classNoThrowForwardIter>voiddestroy(ExecutionPolicy&&exec,// freestanding-deletedNoThrowForwardIterfirst,NoThrowForwardIterlast);template<classNoThrowForwardIter,classSize>constexprNoThrowForwardIterdestroy_n(NoThrowForwardIterfirst,// freestandingSizen);template<classExecutionPolicy,classNoThrowForwardIter,classSize>NoThrowForwardIterdestroy_n(ExecutionPolicy&&exec,// freestanding-deletedNoThrowForwardIterfirst,Sizen);namespaceranges{template<destructibleT>constexprvoiddestroy_at(T*location)noexcept;// freestandingtemplate<no-throw-input-iteratorI,no-throw-sentinel-for<I>S>requiresdestructible<iter_value_t<I>>constexprIdestroy(Ifirst,Slast)noexcept;// freestandingtemplate<no-throw-input-rangeR>requiresdestructible<range_value_t<R>>constexprborrowed_iterator_t<R>destroy(R&&r)noexcept;// freestandingtemplate<no-throw-input-iteratorI>requiresdestructible<iter_value_t<I>>constexprIdestroy_n(Ifirst,iter_difference_t<I>n)noexcept;// freestandingtemplate<execution-policyEp,nothrow-random-access-iteratorI,nothrow-sized-sentinel-for<I>S>requiresdestructible<iter_value_t<I>>Idestroy(Ep&&exec,Ifirst,Slast);// freestanding-deletedtemplate<execution-policyEp,nothrow-sized-random-access-rangeR>requiresdestructible<range_value_t<R>>borrowed_iterator_t<R>destroy(Ep&&exec,R&&r);// freestanding-deletedtemplate<execution-policyEp,nothrow-random-access-iteratorI>requiresdestructible<iter_value_t<I>>Idestroy_n(Ep&&exec,Ifirst,iter_difference_t<I>n);// freestanding-deleted}// class template unique_ptrtemplate<classT>structdefault_delete;// freestandingtemplate<classT>structdefault_delete<T[]>;// freestandingtemplate<classT,classD=default_delete<T>>classunique_ptr;// freestandingtemplate<classT,classD>classunique_ptr<T[],D>;// freestandingtemplate<classT,class...Args>constexprunique_ptr<T>make_unique(Args&&...args);// T is not arraytemplate<classT>constexprunique_ptr<T>make_unique(size_tn);// T is U[]template<classT,class...Args>/* unspecified */make_unique(Args&&...)=delete;// T is U[N]template<classT>constexprunique_ptr<T>make_unique_for_overwrite();// T is not arraytemplate<classT>constexprunique_ptr<T>make_unique_for_overwrite(size_tn);// T is U[]template<classT,class...Args>/* unspecified */make_unique_for_overwrite(Args&&...)=delete;// T is U[N]template<classT,classD>constexprvoidswap(unique_ptr<T,D>&x,unique_ptr<T,D>&y)noexcept;// freestandingtemplate<classT1,classD1,classT2,classD2>constexprbooloperator==(constunique_ptr<T1,D1>&x,// freestandingconstunique_ptr<T2,D2>&y);template<classT1,classD1,classT2,classD2>constexprbooloperator<(constunique_ptr<T1,D1>&x,constunique_ptr<T2,D2>&y);// freestandingtemplate<classT1,classD1,classT2,classD2>constexprbooloperator>(constunique_ptr<T1,D1>&x,constunique_ptr<T2,D2>&y);// freestandingtemplate<classT1,classD1,classT2,classD2>constexprbooloperator<=(constunique_ptr<T1,D1>&x,constunique_ptr<T2,D2>&y);// freestandingtemplate<classT1,classD1,classT2,classD2>constexprbooloperator>=(constunique_ptr<T1,D1>&x,constunique_ptr<T2,D2>&y);// freestandingtemplate<classT1,classD1,classT2,classD2>requiresthree_way_comparable_with<typenameunique_ptr<T1,D1>::pointer,typenameunique_ptr<T2,D2>::pointer>constexprcompare_three_way_result_t<typenameunique_ptr<T1,D1>::pointer,typenameunique_ptr<T2,D2>::pointer>operator<=>(constunique_ptr<T1,D1>&x,constunique_ptr<T2,D2>&y);// freestandingtemplate<classT,classD>constexprbooloperator==(constunique_ptr<T,D>&x,nullptr_t)noexcept;// freestandingtemplate<classT,classD>constexprbooloperator<(constunique_ptr<T,D>&x,nullptr_t);// freestandingtemplate<classT,classD>constexprbooloperator<(nullptr_t,constunique_ptr<T,D>&y);// freestandingtemplate<classT,classD>constexprbooloperator>(constunique_ptr<T,D>&x,nullptr_t);// freestandingtemplate<classT,classD>constexprbooloperator>(nullptr_t,constunique_ptr<T,D>&y);// freestandingtemplate<classT,classD>constexprbooloperator<=(constunique_ptr<T,D>&x,nullptr_t);// freestandingtemplate<classT,classD>constexprbooloperator<=(nullptr_t,constunique_ptr<T,D>&y);// freestandingtemplate<classT,classD>constexprbooloperator>=(constunique_ptr<T,D>&x,nullptr_t);// freestandingtemplate<classT,classD>constexprbooloperator>=(nullptr_t,constunique_ptr<T,D>&y);// freestandingtemplate<classT,classD>requiresthree_way_comparable<typenameunique_ptr<T,D>::pointer>constexprcompare_three_way_result_t<typenameunique_ptr<T,D>::pointer>operator<=>(constunique_ptr<T,D>&x,nullptr_t);// freestandingtemplate<classE,classT,classY,classD>basic_ostream<E,T>&operator<<(basic_ostream<E,T>&os,constunique_ptr<Y,D>&p);// class bad_weak_ptrclassbad_weak_ptr;// class template shared_ptrtemplate<classT>classshared_ptr;// shared_ptr creationtemplate<classT,class...Args>constexprshared_ptr<T>make_shared(Args&&...args);// T is not arraytemplate<classT,classA,class...Args>sconstexprhared_ptr<T>allocate_shared(constA&a,Args&&...args);// T is not arraytemplate<classT>constexprshared_ptr<T>make_shared(size_tN);// T is U[]template<classT,classA>constexprshared_ptr<T>allocate_shared(constA&a,size_tN);// T is U[]template<classT>constexprshared_ptr<T>make_shared();// T is U[N]template<classT,classA>constexprshared_ptr<T>allocate_shared(constA&a);// T is U[N]template<classT>constexprshared_ptr<T>make_shared(size_tN,constremove_extent_t<T>&u);// T is U[]template<classT,classA>constexprshared_ptr<T>allocate_shared(constA&a,size_tN,constremove_extent_t<T>&u);// T is U[]template<classT>constexprshared_ptr<T>make_shared(constremove_extent_t<T>&u);// T is U[N]template<classT,classA>constexprshared_ptr<T>allocate_shared(constA&a,constremove_extent_t<T>&u);// T is U[N]template<classT>constexprshared_ptr<T>make_shared_for_overwrite();// T is not U[]template<classT,classA>constexprshared_ptr<T>allocate_shared_for_overwrite(constA&a);// T is not U[]template<classT>constexprshared_ptr<T>make_shared_for_overwrite(size_tN);// T is U[]template<classT,classA>constexprshared_ptr<T>allocate_shared_for_overwrite(constA&a,size_tN);// T is U[]// shared_ptr comparisonstemplate<classT,classU>constexprbooloperator==(constshared_ptr<T>&a,constshared_ptr<U>&b)noexcept;template<classT,classU>constexprstrong_orderingoperator<=>(constshared_ptr<T>&a,constshared_ptr<U>&b)noexcept;template<classT>constexprbooloperator==(constshared_ptr<T>&x,nullptr_t)noexcept;template<classT>constexprstrong_orderingoperator<=>(constshared_ptr<T>&x,nullptr_t)noexcept;// shared_ptr specialized algorithmstemplate<classT>constexprvoidswap(shared_ptr<T>&a,shared_ptr<T>&b)noexcept;// shared_ptr caststemplate<classT,classU>constexprshared_ptr<T>static_pointer_cast(constshared_ptr<U>&r)noexcept;template<classT,classU>constexprshared_ptr<T>static_pointer_cast(shared_ptr<U>&&r)noexcept;template<classT,classU>constexprshared_ptr<T>dynamic_pointer_cast(constshared_ptr<U>&r)noexcept;template<classT,classU>constexprshared_ptr<T>dynamic_pointer_cast(shared_ptr<U>&&r)noexcept;template<classT,classU>constexprshared_ptr<T>const_pointer_cast(constshared_ptr<U>&r)noexcept;template<classT,classU>constexprshared_ptr<T>const_pointer_cast(shared_ptr<U>&&r)noexcept;template<classT,classU>shared_ptr<T>reinterpret_pointer_cast(constshared_ptr<U>&r)noexcept;template<classT,classU>shared_ptr<T>reinterpret_pointer_cast(shared_ptr<U>&&r)noexcept;// shared_ptr get_deletertemplate<classD,classT>constexprD*get_deleter(constshared_ptr<T>&p)noexcept;// shared_ptr I/Otemplate<classE,classT,classY>basic_ostream<E,T>&operator<<(basic_ostream<E,T>&os,constshared_ptr<Y>&p);// class template weak_ptrtemplate<classT>classweak_ptr;// weak_ptr specialized algorithmstemplate<classT>constexprvoidswap(weak_ptr<T>&a,weak_ptr<T>&b)noexcept;// class template owner_lesstemplate<classT=void>structowner_less;// struct owner_hashstructowner_hash;// struct owner_equalstructowner_equal;// class template enable_shared_from_thistemplate<classT>classenable_shared_from_this;// hash supporttemplate<classT>structhash;// freestandingtemplate<classT,classD>structhash<unique_ptr<T,D>>;// freestandingtemplate<classT>structhash<shared_ptr<T>>;// atomic smart pointerstemplate<classT>structatomic;// freestandingtemplate<classT>structatomic<shared_ptr<T>>;template<classT>structatomic<weak_ptr<T>>;// class template out_ptr_ttemplate<classSmart,classPointer,class...Args>classout_ptr_t;// freestanding// function template out_ptrtemplate<classPointer=void,classSmart,class...Args>constexprautoout_ptr(Smart&s,Args&&...args);// freestanding// class template inout_ptr_ttemplate<classSmart,classPointer,class...Args>classinout_ptr_t;// freestanding// function template inout_ptrtemplate<classPointer=void,classSmart,class...Args>constexprautoinout_ptr(Smart&s,Args&&...args);// freestanding// class template indirecttemplate<classT,classAllocator=allocator<T>>classindirect;// hash supporttemplate<classT,classAlloc>structhash<indirect<T,Alloc>>;// class template polymorphictemplate<classT,classAllocator=allocator<T>>classpolymorphic;namespacepmr{template<classT>usingindirect=indirect<T,polymorphic_allocator<T>>;template<classT>usingpolymorphic=polymorphic<T,polymorphic_allocator<T>>;}}namespacestd{template<classPtr>structpointer_traits{/* see description */;};template<classT>structpointer_traits<T*>{usingpointer=T*;usingelement_type=T;usingdifference_type=ptrdiff_t;template<classU>usingrebind=U*;staticconstexprpointerpointer_to(/* see description */r)noexcept;};}namespacestd{structallocator_arg_t{explicitallocator_arg_t()=default;};inlineconstexprallocator_arg_tallocator_arg{};}namespacestd{template<classAlloc>structallocator_traits{usingallocator_type=Alloc;usingvalue_type=typenameAlloc::value_type;usingpointer=/* see description */;usingconst_pointer=/* see description */;usingvoid_pointer=/* see description */;usingconst_void_pointer=/* see description */;usingdifference_type=/* see description */;usingsize_type=/* see description */;usingpropagate_on_container_copy_assignment=/* see description */;usingpropagate_on_container_move_assignment=/* see description */;usingpropagate_on_container_swap=/* see description */;usingis_always_equal=/* see description */;template<classT>usingrebind_alloc=/* see description */;template<classT>usingrebind_traits=allocator_traits<rebind_alloc<T>>;staticconstexprpointerallocate(Alloc&a,size_typen);staticconstexprpointerallocate(Alloc&a,size_typen,const_void_pointerhint);staticconstexprallocation_result<pointer,size_type>allocate_at_least(Alloc&a,size_typen);staticconstexprvoiddeallocate(Alloc&a,pointerp,size_typen);template<classT,class...Args>staticconstexprvoidconstruct(Alloc&a,T*p,Args&&...args);template<classT>staticconstexprvoiddestroy(Alloc&a,T*p);staticconstexprsize_typemax_size(constAlloc&a)noexcept;staticconstexprAllocselect_on_container_copy_construction(constAlloc&rhs);};}namespacestd{template<classT>classallocator{public:usingvalue_type=T;usingsize_type=size_t;usingdifference_type=ptrdiff_t;usingpropagate_on_container_move_assignment=true_type;constexprallocator()noexcept;constexprallocator(constallocator&)noexcept;template<classU>constexprallocator(constallocator<U>&)noexcept;constexpr~allocator();constexprallocator&operator=(constallocator&)=default;constexprT*allocate(size_tn);constexprallocation_result<T*>allocate_at_least(size_tn);constexprvoiddeallocate(T*p,size_tn);};}namespacestd{template<classT>structdefault_delete{constexprdefault_delete()noexcept=default;template<classU>constexprdefault_delete(constdefault_delete<U>&)noexcept;constexprvoidoperator()(T*)const;};template<classT>structdefault_delete<T[]>{constexprdefault_delete()noexcept=default;template<classU>constexprdefault_delete(constdefault_delete<U[]>&)noexcept;template<classU>constexprvoidoperator()(U*ptr)const;};}namespacestd{template<classT,classD=default_delete<T>>classunique_ptr{public:usingpointer=/* see description */;usingelement_type=T;usingdeleter_type=D;// constructorsconstexprunique_ptr()noexcept;constexprexplicitunique_ptr(type_identity_t<pointer>p)noexcept;constexprunique_ptr(type_identity_t<pointer>p,/* see description */d1)noexcept;constexprunique_ptr(type_identity_t<pointer>p,/* see description */d2)noexcept;constexprunique_ptr(unique_ptr&&u)noexcept;constexprunique_ptr(nullptr_t)noexcept;template<classU,classE>constexprunique_ptr(unique_ptr<U,E>&&u)noexcept;// destructorconstexpr~unique_ptr();// assignmentconstexprunique_ptr&operator=(unique_ptr&&u)noexcept;template<classU,classE>constexprunique_ptr&operator=(unique_ptr<U,E>&&u)noexcept;constexprunique_ptr&operator=(nullptr_t)noexcept;// observersconstexpradd_lvalue_reference_t<T>operator*()constnoexcept(/* see description */);constexprpointeroperator->()constnoexcept;constexprpointerget()constnoexcept;constexprdeleter_type&get_deleter()noexcept;constexprconstdeleter_type&get_deleter()constnoexcept;constexprexplicitoperatorbool()constnoexcept;// modifiersconstexprpointerrelease()noexcept;constexprvoidreset(pointerp=pointer())noexcept;constexprvoidswap(unique_ptr&u)noexcept;// disable copy from lvalueunique_ptr(constunique_ptr&)=delete;unique_ptr&operator=(constunique_ptr&)=delete;};template<classT,classD>classunique_ptr<T[],D>{public:usingpointer=/* see description */;usingelement_type=T;usingdeleter_type=D;// constructorsconstexprunique_ptr()noexcept;template<classU>constexprexplicitunique_ptr(Up)noexcept;template<classU>constexprunique_ptr(Up,/* see description */d)noexcept;template<classU>constexprunique_ptr(Up,/* see description */d)noexcept;constexprunique_ptr(unique_ptr&&u)noexcept;template<classU,classE>constexprunique_ptr(unique_ptr<U,E>&&u)noexcept;constexprunique_ptr(nullptr_t)noexcept;// destructorconstexpr~unique_ptr();// assignmentconstexprunique_ptr&operator=(unique_ptr&&u)noexcept;template<classU,classE>constexprunique_ptr&operator=(unique_ptr<U,E>&&u)noexcept;constexprunique_ptr&operator=(nullptr_t)noexcept;// observersconstexprT&operator[](size_ti)const;constexprpointerget()constnoexcept;constexprdeleter_type&get_deleter()noexcept;constexprconstdeleter_type&get_deleter()constnoexcept;constexprexplicitoperatorbool()constnoexcept;// modifiersconstexprpointerrelease()noexcept;template<classU>constexprvoidreset(Up)noexcept;constexprvoidreset(nullptr_t=nullptr)noexcept;constexprvoidswap(unique_ptr&u)noexcept;// disable copy from lvalueunique_ptr(constunique_ptr&)=delete;unique_ptr&operator=(constunique_ptr&)=delete;};}namespacestd{classbad_weak_ptr:publicexception{public:// for the specification of the special member functionsconstexprconstchar*what()constnoexceptoverride;};}namespacestd{template<classT>classshared_ptr{public:usingelement_type=remove_extent_t<T>;usingweak_type=weak_ptr<T>;// constructorsconstexprshared_ptr()noexcept;constexprshared_ptr(nullptr_t)noexcept:shared_ptr(){}template<classY>constexprexplicitshared_ptr(Y*p);template<classY,classD>constexprshared_ptr(Y*p,Dd);template<classY,classD,classA>constexprshared_ptr(Y*p,Dd,Aa);template<classD>constexprshared_ptr(nullptr_tp,Dd);template<classD,classA>constexprshared_ptr(nullptr_tp,Dd,Aa);template<classY>constexprshared_ptr(constshared_ptr<Y>&r,element_type*p)noexcept;template<classY>constexprshared_ptr(shared_ptr<Y>&&r,element_type*p)noexcept;constexprshared_ptr(constshared_ptr&r)noexcept;template<classY>constexprshared_ptr(constshared_ptr<Y>&r)noexcept;constexprshared_ptr(shared_ptr&&r)noexcept;template<classY>constexprshared_ptr(shared_ptr<Y>&&r)noexcept;template<classY>constexprexplicitshared_ptr(constweak_ptr<Y>&r);template<classY,classD>constexprshared_ptr(unique_ptr<Y,D>&&r);// destructorconstexpr~shared_ptr();// assignmentconstexprshared_ptr&operator=(constshared_ptr&r)noexcept;template<classY>constexprshared_ptr&operator=(constshared_ptr<Y>&r)noexcept;constexprshared_ptr&operator=(shared_ptr&&r)noexcept;template<classY>constexprshared_ptr&operator=(shared_ptr<Y>&&r)noexcept;template<classY,classD>constexprshared_ptr&operator=(unique_ptr<Y,D>&&r);// modifiersconstexprvoidswap(shared_ptr&r)noexcept;constexprvoidreset()noexcept;template<classY>constexprvoidreset(Y*p);template<classY,classD>constexprvoidreset(Y*p,Dd);template<classY,classD,classA>constexprvoidreset(Y*p,Dd,Aa);// observersconstexprelement_type*get()constnoexcept;constexprT&operator*()constnoexcept;constexprT*operator->()constnoexcept;constexprelement_type&operator[](ptrdiff_ti)const;constexprlonguse_count()constnoexcept;constexprexplicitoperatorbool()constnoexcept;template<classU>constexprboolowner_before(constshared_ptr<U>&b)constnoexcept;template<classU>constexprboolowner_before(constweak_ptr<U>&b)constnoexcept;size_towner_hash()constnoexcept;template<classU>constexprboolowner_equal(constshared_ptr<U>&b)constnoexcept;template<classU>constexprboolowner_equal(constweak_ptr<U>&b)constnoexcept;};template<classT>shared_ptr(weak_ptr<T>)->shared_ptr<T>;template<classT,classD>shared_ptr(unique_ptr<T,D>)->shared_ptr<T>;}namespacestd{template<classT>classweak_ptr{public:usingelement_type=remove_extent_t<T>;// constructorsconstexprweak_ptr()noexcept;template<classY>constexprweak_ptr(constshared_ptr<Y>&r)noexcept;constexprweak_ptr(constweak_ptr&r)noexcept;template<classY>constexprweak_ptr(constweak_ptr<Y>&r)noexcept;constexprweak_ptr(weak_ptr&&r)noexcept;template<classY>constexprweak_ptr(weak_ptr<Y>&&r)noexcept;// destructorconstexpr~weak_ptr();// assignmentconstexprweak_ptr&operator=(constweak_ptr&r)noexcept;template<classY>constexprweak_ptr&operator=(constweak_ptr<Y>&r)noexcept;template<classY>constexprweak_ptr&operator=(constshared_ptr<Y>&r)noexcept;constexprweak_ptr&operator=(weak_ptr&&r)noexcept;template<classY>constexprweak_ptr&operator=(weak_ptr<Y>&&r)noexcept;// modifiersconstexprvoidswap(weak_ptr&r)noexcept;constexprvoidreset()noexcept;// observersconstexprlonguse_count()constnoexcept;constexprboolexpired()constnoexcept;constexprshared_ptr<T>lock()constnoexcept;template<classU>constexprboolowner_before(constshared_ptr<U>&b)constnoexcept;template<classU>constexprboolowner_before(constweak_ptr<U>&b)constnoexcept;size_towner_hash()constnoexcept;template<classU>constexprboolowner_equal(constshared_ptr<U>&b)constnoexcept;template<classU>constexprboolowner_equal(constweak_ptr<U>&b)constnoexcept;};template<classT>weak_ptr(shared_ptr<T>)->weak_ptr<T>;}namespacestd{template<classT=void>structowner_less;template<classT>structowner_less<shared_ptr<T>>{constexprbooloperator()(constshared_ptr<T>&,constshared_ptr<T>&)constnoexcept;constexprbooloperator()(constshared_ptr<T>&,constweak_ptr<T>&)constnoexcept;constexprbooloperator()(constweak_ptr<T>&,constshared_ptr<T>&)constnoexcept;};template<classT>structowner_less<weak_ptr<T>>{constexprbooloperator()(constweak_ptr<T>&,constweak_ptr<T>&)constnoexcept;constexprbooloperator()(constshared_ptr<T>&,constweak_ptr<T>&)constnoexcept;constexprbooloperator()(constweak_ptr<T>&,constshared_ptr<T>&)constnoexcept;};template<>structowner_less<void>{template<classT,classU>constexprbooloperator()(constshared_ptr<T>&,constshared_ptr<U>&)constnoexcept;template<classT,classU>constexprbooloperator()(constshared_ptr<T>&,constweak_ptr<U>&)constnoexcept;template<classT,classU>constexprbooloperator()(constweak_ptr<T>&,constshared_ptr<U>&)constnoexcept;template<classT,classU>constexprbooloperator()(constweak_ptr<T>&,constweak_ptr<U>&)constnoexcept;usingis_transparent=/* unspecified */;};}namespacestd{structowner_hash{template<classT>size_toperator()(constshared_ptr<T>&)constnoexcept;template<classT>size_toperator()(constweak_ptr<T>&)constnoexcept;usingis_transparent=/* unspecified */;};}namespacestd{structowner_equal{template<classT,classU>constexprbooloperator()(constshared_ptr<T>&,constshared_ptr<U>&)constnoexcept;template<classT,classU>constexprbooloperator()(constshared_ptr<T>&,constweak_ptr<U>&)constnoexcept;template<classT,classU>constexprbooloperator()(constweak_ptr<T>&,constshared_ptr<U>&)constnoexcept;template<classT,classU>constexprbooloperator()(constweak_ptr<T>&,constweak_ptr<U>&)constnoexcept;usingis_transparent=/* unspecified */;};}namespacestd{template<classT>classenable_shared_from_this{protected:constexprenable_shared_from_this()noexcept;constexprenable_shared_from_this(constenable_shared_from_this&)noexcept;constexprenable_shared_from_this&operator=(constenable_shared_from_this&)noexcept;constexpr~enable_shared_from_this();public:constexprshared_ptr<T>shared_from_this();constexprshared_ptr<Tconst>shared_from_this()const;constexprweak_ptr<T>weak_from_this()noexcept;constexprweak_ptr<Tconst>weak_from_this()constnoexcept;private:mutableweak_ptr<T>/*weak-this*/;// exposition-only};}namespacestd{template<classT>structatomic<shared_ptr<T>>{usingvalue_type=shared_ptr<T>;staticconstexprboolis_always_lock_free=/* implementation-defined */;boolis_lock_free()constnoexcept;constexpratomic()noexcept=default;constexpratomic(nullptr_t)noexcept:atomic(){}constexpratomic(shared_ptr<T>desired)noexcept;atomic(constatomic&)=delete;voidoperator=(constatomic&)=delete;constexprshared_ptr<T>load(memory_orderorder=memory_order::seq_cst)constnoexcept;constexproperatorshared_ptr<T>()constnoexcept;constexprvoidstore(shared_ptr<T>desired,memory_orderorder=memory_order::seq_cst)noexcept;constexprvoidoperator=(shared_ptr<T>desired)noexcept;constexprvoidoperator=(nullptr_t)noexcept;constexprshared_ptr<T>exchange(shared_ptr<T>desired,memory_orderorder=memory_order::seq_cst)noexcept;constexprboolcompare_exchange_weak(shared_ptr<T>&expected,shared_ptr<T>desired,memory_ordersuccess,memory_orderfailure)noexcept;constexprboolcompare_exchange_strong(shared_ptr<T>&expected,shared_ptr<T>desired,memory_ordersuccess,memory_orderfailure)noexcept;constexprboolcompare_exchange_weak(shared_ptr<T>&expected,shared_ptr<T>desired,memory_orderorder=memory_order::seq_cst)noexcept;constexprboolcompare_exchange_strong(shared_ptr<T>&expected,shared_ptr<T>desired,memory_orderorder=memory_order::seq_cst)noexcept;constexprvoidwait(shared_ptr<T>old,memory_orderorder=memory_order::seq_cst)constnoexcept;constexprvoidnotify_one()noexcept;constexprvoidnotify_all()noexcept;private:shared_ptr<T>p;// exposition only};}namespacestd{template<classT>structatomic<weak_ptr<T>>{usingvalue_type=weak_ptr<T>;staticconstexprboolis_always_lock_free=/* implementation-defined */;boolis_lock_free()constnoexcept;constexpratomic()noexcept=default;constexpratomic(weak_ptr<T>desired)noexcept;atomic(constatomic&)=delete;voidoperator=(constatomic&)=delete;constexprweak_ptr<T>load(memory_orderorder=memory_order::seq_cst)constnoexcept;constexproperatorweak_ptr<T>()constnoexcept;constexprvoidstore(weak_ptr<T>desired,memory_orderorder=memory_order::seq_cst)noexcept;constexprvoidoperator=(weak_ptr<T>desired)noexcept;constexprweak_ptr<T>exchange(weak_ptr<T>desired,memory_orderorder=memory_order::seq_cst)noexcept;constexprboolcompare_exchange_weak(weak_ptr<T>&expected,shared_ptr<T>desired,memory_ordersuccess,memory_orderfailure)noexcept;constexprboolcompare_exchange_strong(weak_ptr<T>&expected,shared_ptr<T>desired,memory_ordersuccess,memory_orderfailure)noexcept;constexprboolcompare_exchange_weak(weak_ptr<T>&expected,shared_ptr<T>desired,memory_orderorder=memory_order::seq_cst)noexcept;constexprboolcompare_exchange_strong(weak_ptr<T>&expected,shared_ptr<T>desired,memory_orderorder=memory_order::seq_cst)noexcept;constexprvoidwait(weak_ptr<T>old,memory_orderorder=memory_order::seq_cst)constnoexcept;constexprvoidnotify_one()noexcept;constexprvoidnotify_all()noexcept;private:weak_ptr<T>p;// exposition only};}namespacestd{template<classSmart,classPointer,class...Args>classout_ptr_t{public:constexprexplicitout_ptr_t(Smart&,Args...);out_ptr_t(constout_ptr_t&)=delete;constexpr~out_ptr_t();constexproperatorPointer*()constnoexcept;operatorvoid**()constnoexcept;private:Smart&s;// exposition-onlytuple<Args...>a;// exposition-onlyPointerp;// exposition-only};}namespacestd{template<classSmart,classPointer,class...Args>classinout_ptr_t{public:constexprexplicitinout_ptr_t(Smart&,Args...);inout_ptr_t(constinout_ptr_t&)=delete;constexpr~inout_ptr_t();constexproperatorPointer*()constnoexcept;operatorvoid**()constnoexcept;private:Smart&s;// exposition-onlytuple<Args...>a;// exposition-onlyPointerp;// exposition-only};}namespacestd{template<classT,classAllocator=allocator<T>>classindirect{public:usingvalue_type=T;usingallocator_type=Allocator;usingpointer=typenameallocator_traits<Allocator>::pointer;usingconst_pointer=typenameallocator_traits<Allocator>::const_pointer;// constructorsconstexprexplicitindirect();constexprexplicitindirect(allocator_arg_t,constAllocator&a);constexprindirect(constindirect&other);constexprindirect(allocator_arg_t,constAllocator&a,constindirect&other);constexprindirect(indirect&&other)noexcept;constexprindirect(allocator_arg_t,constAllocator&a,indirect&&other)noexcept(/* see description */);template<classU=T>constexprexplicitindirect(U&&u);template<classU=T>constexprexplicitindirect(allocator_arg_t,constAllocator&a,U&&u);template<class...Us>constexprexplicitindirect(in_place_t,Us&&...us);template<class...Us>constexprexplicitindirect(allocator_arg_t,constAllocator&a,in_place_t,Us&&...us);template<classI,class...Us>constexprexplicitindirect(in_place_t,initializer_list<I>ilist,Us&&...us);template<classI,class...Us>constexprexplicitindirect(allocator_arg_t,constAllocator&a,in_place_t,initializer_list<I>ilist,Us&&...us);// destructorconstexpr~indirect();// assignmentconstexprindirect&operator=(constindirect&other);constexprindirect&operator=(indirect&&other)noexcept(/* see description */);template<classU=T>constexprindirect&operator=(U&&u);// observersconstexprconstT&operator*()const&noexcept;constexprT&operator*()&noexcept;constexprconstT&&operator*()const&&noexcept;constexprT&&operator*()&&noexcept;constexprconst_pointeroperator->()constnoexcept;constexprpointeroperator->()noexcept;constexprboolvalueless_after_move()constnoexcept;constexprallocator_typeget_allocator()constnoexcept;// swapconstexprvoidswap(indirect&other)noexcept(/* see description */);friendconstexprvoidswap(indirect&lhs,indirect&rhs)noexcept(/* see description */);// relational operatorstemplate<classU,classAA>friendconstexprbooloperator==(constindirect&lhs,constindirect<U,AA>&rhs)noexcept(/* see description */);template<classU,classAA>friendconstexprautooperator<=>(constindirect&lhs,constindirect<U,AA>&rhs)->/*synth-three-way-result*/<T,U>;// comparison with Ttemplate<classU>friendconstexprbooloperator==(constindirect&lhs,constU&rhs)noexcept(/* see description */);template<classU>friendconstexprautooperator<=>(constindirect&lhs,constU&rhs)->/*synth-three-way-result*/<T,U>;private:pointer/*p*/;// exposition-onlyAllocator/*alloc*/=Allocator();// exposition-only};template<classValue>indirect(Value)->indirect<Value>;template<classAllocator,classValue>indirect(allocator_arg_t,Allocator,Value)->indirect<Value,typenameallocator_traits<Allocator>::templaterebind_alloc<Value>>;}namespacestd{template<classT,classAllocator=allocator<T>>classpolymorphic{public:usingvalue_type=T;usingallocator_type=Allocator;usingpointer=typenameallocator_traits<Allocator>::pointer;usingconst_pointer=typenameallocator_traits<Allocator>::const_pointer;// constructorsconstexprexplicitpolymorphic();constexprexplicitpolymorphic(allocator_arg_t,constAllocator&a);constexprpolymorphic(constpolymorphic&other);constexprpolymorphic(allocator_arg_t,constAllocator&a,constpolymorphic&other);constexprpolymorphic(polymorphic&&other)noexcept;constexprpolymorphic(allocator_arg_t,constAllocator&a,polymorphic&&other)noexcept(/* see description */);template<classU=T>constexprexplicitpolymorphic(U&&u);template<classU=T>constexprexplicitpolymorphic(allocator_arg_t,constAllocator&a,U&&u);template<classU,class...Ts>constexprexplicitpolymorphic(in_place_type_t<U>,Ts&&...ts);template<classU,class...Ts>constexprexplicitpolymorphic(allocator_arg_t,constAllocator&a,in_place_type_t<U>,Ts&&...ts);template<classU,classI,class...Us>constexprexplicitpolymorphic(in_place_type_t<U>,initializer_list<I>ilist,Us&&...us);template<classU,classI,class...Us>constexprexplicitpolymorphic(allocator_arg_t,constAllocator&a,in_place_type_t<U>,initializer_list<I>ilist,Us&&...us);// destructorconstexpr~polymorphic();// assignmentconstexprpolymorphic&operator=(constpolymorphic&other);constexprpolymorphic&operator=(polymorphic&&other)noexcept(/* see description */);// observersconstexprconstT&operator*()constnoexcept;constexprT&operator*()noexcept;constexprconst_pointeroperator->()constnoexcept;constexprpointeroperator->()noexcept;constexprboolvalueless_after_move()constnoexcept;constexprallocator_typeget_allocator()constnoexcept;// swapconstexprvoidswap(polymorphic&other)noexcept(/* see description */);friendconstexprvoidswap(polymorphic&lhs,polymorphic&rhs)noexcept(/* see description */);private:Allocator/*alloc*/=Allocator();// exposition-only};}