.TH "std::allocator_traits< _Alloc >" 3cxx "Wed Jul 28 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::allocator_traits< _Alloc > \- Uniform interface to all allocator types\&. .SH SYNOPSIS .br .PP .PP Inherits std::__allocator_traits_base\&. .PP Inherited by \fB__gnu_cxx::__alloc_traits< _Alloc, typename >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef _Alloc \fBallocator_type\fP" .br .RI "The allocator type\&. " .ti -1c .RI "using \fBconst_pointer\fP = typename _Ptr< __c_pointer, const \fBvalue_type\fP >::type" .br .RI "The allocator's const pointer type\&. " .ti -1c .RI "using \fBconst_void_pointer\fP = typename _Ptr< __cv_pointer, const void >::type" .br .RI "The allocator's const void pointer type\&. " .ti -1c .RI "using \fBdifference_type\fP = typename _Diff< _Alloc, \fBpointer\fP >::type" .br .RI "The allocator's difference type\&. " .ti -1c .RI "using \fBis_always_equal\fP = __detected_or_t< typename \fBis_empty\fP< _Alloc >::type, __equal, _Alloc >" .br .RI "Whether all instances of the allocator type compare equal\&. " .ti -1c .RI "using \fBpointer\fP = __detected_or_t< \fBvalue_type\fP *, __pointer, _Alloc >" .br .RI "The allocator's pointer type\&. " .ti -1c .RI "using \fBpropagate_on_container_copy_assignment\fP = __detected_or_t< \fBfalse_type\fP, __pocca, _Alloc >" .br .RI "How the allocator is propagated on copy assignment\&. " .ti -1c .RI "using \fBpropagate_on_container_move_assignment\fP = __detected_or_t< \fBfalse_type\fP, __pocma, _Alloc >" .br .RI "How the allocator is propagated on move assignment\&. " .ti -1c .RI "using \fBpropagate_on_container_swap\fP = __detected_or_t< \fBfalse_type\fP, __pocs, _Alloc >" .br .RI "How the allocator is propagated on swap\&. " .ti -1c .RI "template using \fBrebind_alloc\fP = __alloc_rebind< _Alloc, _Tp >" .br .ti -1c .RI "template using \fBrebind_traits\fP = \fBallocator_traits\fP< rebind_alloc< _Tp > >" .br .ti -1c .RI "using \fBsize_type\fP = typename _Size< _Alloc, \fBdifference_type\fP >::type" .br .RI "The allocator's size type\&. " .ti -1c .RI "typedef _Alloc::value_type \fBvalue_type\fP" .br .RI "The allocated type\&. " .ti -1c .RI "using \fBvoid_pointer\fP = typename _Ptr< __v_pointer, void >::type" .br .RI "The allocator's void pointer type\&. " .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static constexpr \fBpointer\fP \fBallocate\fP (_Alloc &__a, \fBsize_type\fP __n)" .br .RI "Allocate memory\&. " .ti -1c .RI "static constexpr \fBpointer\fP \fBallocate\fP (_Alloc &__a, \fBsize_type\fP __n, \fBconst_void_pointer\fP __hint)" .br .RI "Allocate memory\&. " .ti -1c .RI "template static constexpr auto \fBconstruct\fP (_Alloc &__a, _Tp *__p, _Args &&\&.\&.\&. __args) noexcept(noexcept(_S_construct(__a, __p, \fBstd::forward\fP< _Args >(__args)\&.\&.\&.))) \-> decltype(_S_construct(__a, __p, \fBstd::forward\fP< _Args >(__args)\&.\&.\&.))" .br .RI "Construct an object of type \fC_Tp\fP " .ti -1c .RI "static constexpr void \fBdeallocate\fP (_Alloc &__a, \fBpointer\fP __p, \fBsize_type\fP __n)" .br .RI "Deallocate memory\&. " .ti -1c .RI "template static constexpr void \fBdestroy\fP (_Alloc &__a, _Tp *__p) noexcept(noexcept(_S_destroy(__a, __p, 0)))" .br .RI "Destroy an object of type \fI_Tp\fP\&. " .ti -1c .RI "static constexpr \fBsize_type\fP \fBmax_size\fP (const _Alloc &__a) noexcept" .br .RI "The maximum supported allocation size\&. " .ti -1c .RI "static constexpr _Alloc \fBselect_on_container_copy_construction\fP (const _Alloc &__rhs)" .br .RI "Obtain an allocator to use when copying a container\&. " .in -1c .SS "Protected Types" .in +1c .ti -1c .RI "template using \fB__c_pointer\fP = typename _Tp::const_pointer" .br .ti -1c .RI "template using \fB__cv_pointer\fP = typename _Tp::const_void_pointer" .br .ti -1c .RI "template using \fB__equal\fP = typename _Tp::is_always_equal" .br .ti -1c .RI "template using \fB__pocca\fP = typename _Tp::propagate_on_container_copy_assignment" .br .ti -1c .RI "template using \fB__pocma\fP = typename _Tp::propagate_on_container_move_assignment" .br .ti -1c .RI "template using \fB__pocs\fP = typename _Tp::propagate_on_container_swap" .br .ti -1c .RI "template using \fB__pointer\fP = typename _Tp::pointer" .br .ti -1c .RI "template using \fB__v_pointer\fP = typename _Tp::void_pointer" .br .in -1c .SH "Detailed Description" .PP .SS "template .br struct std::allocator_traits< _Alloc >" Uniform interface to all allocator types\&. .PP Definition at line 86 of file bits/alloc_traits\&.h\&. .SH "Member Typedef Documentation" .PP .SS "template typedef _Alloc \fBstd::allocator_traits\fP< _Alloc >::\fBallocator_type\fP" .PP The allocator type\&. .PP Definition at line 89 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBconst_pointer\fP = typename _Ptr<__c_pointer, const \fBvalue_type\fP>::type" .PP The allocator's const pointer type\&. \fCAlloc::const_pointer\fP if that type exists, otherwise \fC pointer_traits::rebind \fP .PP Definition at line 138 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBconst_void_pointer\fP = typename _Ptr<__cv_pointer, const void>::type" .PP The allocator's const void pointer type\&. \fCAlloc::const_void_pointer\fP if that type exists, otherwise \fC pointer_traits::rebind \fP .PP Definition at line 154 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBdifference_type\fP = typename _Diff<_Alloc, \fBpointer\fP>::type" .PP The allocator's difference type\&. \fCAlloc::difference_type\fP if that type exists, otherwise \fC pointer_traits::difference_type \fP .PP Definition at line 162 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBis_always_equal\fP = __detected_or_t::type, __equal, _Alloc>" .PP Whether all instances of the allocator type compare equal\&. \fCAlloc::is_always_equal\fP if that type exists, otherwise \fCis_empty::type\fP .PP Definition at line 205 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBpointer\fP = __detected_or_t<\fBvalue_type\fP*, __pointer, _Alloc>" .PP The allocator's pointer type\&. \fCAlloc::pointer\fP if that type exists, otherwise \fCvalue_type*\fP .PP Definition at line 98 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBpropagate_on_container_copy_assignment\fP = __detected_or_t<\fBfalse_type\fP, __pocca, _Alloc>" .PP How the allocator is propagated on copy assignment\&. \fCAlloc::propagate_on_container_copy_assignment\fP if that type exists, otherwise \fCfalse_type\fP .PP Definition at line 178 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBpropagate_on_container_move_assignment\fP = __detected_or_t<\fBfalse_type\fP, __pocma, _Alloc>" .PP How the allocator is propagated on move assignment\&. \fCAlloc::propagate_on_container_move_assignment\fP if that type exists, otherwise \fCfalse_type\fP .PP Definition at line 187 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBpropagate_on_container_swap\fP = __detected_or_t<\fBfalse_type\fP, __pocs, _Alloc>" .PP How the allocator is propagated on swap\&. \fCAlloc::propagate_on_container_swap\fP if that type exists, otherwise \fCfalse_type\fP .PP Definition at line 196 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBsize_type\fP = typename _Size<_Alloc, \fBdifference_type\fP>::type" .PP The allocator's size type\&. \fCAlloc::size_type\fP if that type exists, otherwise \fC make_unsigned::type \fP .PP Definition at line 170 of file bits/alloc_traits\&.h\&. .SS "template typedef _Alloc::value_type \fBstd::allocator_traits\fP< _Alloc >::\fBvalue_type\fP" .PP The allocated type\&. .PP Definition at line 91 of file bits/alloc_traits\&.h\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::\fBvoid_pointer\fP = typename _Ptr<__v_pointer, void>::type" .PP The allocator's void pointer type\&. \fCAlloc::void_pointer\fP if that type exists, otherwise \fC pointer_traits::rebind \fP .PP Definition at line 146 of file bits/alloc_traits\&.h\&. .SH "Member Function Documentation" .PP .SS "template static constexpr \fBpointer\fP \fBstd::allocator_traits\fP< _Alloc >::allocate (_Alloc & __a, \fBsize_type\fP __n)\fC [inline]\fP, \fC [static]\fP, \fC [constexpr]\fP" .PP Allocate memory\&. .PP \fBParameters\fP .RS 4 \fI__a\fP An allocator\&. .br \fI__n\fP The number of objects to allocate space for\&. .RE .PP Calls \fCa\&.allocate(n)\fP .PP Definition at line 313 of file bits/alloc_traits\&.h\&. .PP Referenced by std::__allocate_guarded()\&. .SS "template static constexpr \fBpointer\fP \fBstd::allocator_traits\fP< _Alloc >::allocate (_Alloc & __a, \fBsize_type\fP __n, \fBconst_void_pointer\fP __hint)\fC [inline]\fP, \fC [static]\fP, \fC [constexpr]\fP" .PP Allocate memory\&. .PP \fBParameters\fP .RS 4 \fI__a\fP An allocator\&. .br \fI__n\fP The number of objects to allocate space for\&. .br \fI__hint\fP Aid to locality\&. .RE .PP \fBReturns\fP .RS 4 Memory of suitable size and alignment for \fIn\fP objects of type \fCvalue_type\fP .RE .PP Returns \fC a\&.allocate(n, hint) \fP if that expression is well-formed, otherwise returns \fCa\&.allocate(n)\fP .PP Definition at line 328 of file bits/alloc_traits\&.h\&. .SS "template template static constexpr auto \fBstd::allocator_traits\fP< _Alloc >::construct (_Alloc & __a, _Tp * __p, _Args &&\&.\&.\&. __args) \-> decltype(_S_construct(__a, __p, \fBstd::forward\fP<_Args>(__args)\&.\&.\&.)) \fC [inline]\fP, \fC [static]\fP, \fC [constexpr]\fP, \fC [noexcept]\fP" .PP Construct an object of type \fC_Tp\fP .PP \fBParameters\fP .RS 4 \fI__a\fP An allocator\&. .br \fI__p\fP Pointer to memory of suitable size and alignment for Tp .br \fI__args\fP Constructor arguments\&. .RE .PP Calls \fC __a\&.construct(__p, std::forward(__args)\&.\&.\&.) \fP if that expression is well-formed, otherwise uses placement-new to construct an object of type \fI_Tp\fP at location \fI__p\fP from the arguments \fI__args\fP\&.\&.\&. .PP Definition at line 356 of file bits/alloc_traits\&.h\&. .SS "template static constexpr void \fBstd::allocator_traits\fP< _Alloc >::deallocate (_Alloc & __a, \fBpointer\fP __p, \fBsize_type\fP __n)\fC [inline]\fP, \fC [static]\fP, \fC [constexpr]\fP" .PP Deallocate memory\&. .PP \fBParameters\fP .RS 4 \fI__a\fP An allocator\&. .br \fI__p\fP Pointer to the memory to deallocate\&. .br \fI__n\fP The number of objects space was allocated for\&. .RE .PP Calls \fC a\&.deallocate(p, n) \fP .PP Definition at line 340 of file bits/alloc_traits\&.h\&. .PP Referenced by std::__allocated_ptr< _Alloc >::~__allocated_ptr()\&. .SS "template template static constexpr void \fBstd::allocator_traits\fP< _Alloc >::destroy (_Alloc & __a, _Tp * __p)\fC [inline]\fP, \fC [static]\fP, \fC [constexpr]\fP, \fC [noexcept]\fP" .PP Destroy an object of type \fI_Tp\fP\&. .PP \fBParameters\fP .RS 4 \fI__a\fP An allocator\&. .br \fI__p\fP Pointer to the object to destroy .RE .PP Calls \fC__a\&.destroy(__p)\fP if that expression is well-formed, otherwise calls \fC__p->~_Tp()\fP .PP Definition at line 372 of file bits/alloc_traits\&.h\&. .PP Referenced by std::_Destroy()\&. .SS "template static constexpr \fBsize_type\fP \fBstd::allocator_traits\fP< _Alloc >::max_size (const _Alloc & __a)\fC [inline]\fP, \fC [static]\fP, \fC [constexpr]\fP, \fC [noexcept]\fP" .PP The maximum supported allocation size\&. .PP \fBParameters\fP .RS 4 \fI__a\fP An allocator\&. .RE .PP \fBReturns\fP .RS 4 \fC__a\&.max_size()\fP or \fCnumeric_limits::max()\fP .RE .PP Returns \fC__a\&.max_size()\fP if that expression is well-formed, otherwise returns \fCnumeric_limits::max()\fP .PP Definition at line 385 of file bits/alloc_traits\&.h\&. .SS "template static constexpr _Alloc \fBstd::allocator_traits\fP< _Alloc >::select_on_container_copy_construction (const _Alloc & __rhs)\fC [inline]\fP, \fC [static]\fP, \fC [constexpr]\fP" .PP Obtain an allocator to use when copying a container\&. .PP \fBParameters\fP .RS 4 \fI__rhs\fP An allocator\&. .RE .PP \fBReturns\fP .RS 4 \fC__rhs\&.select_on_container_copy_construction()\fP or \fI__rhs\fP .RE .PP Returns \fC__rhs\&.select_on_container_copy_construction()\fP if that expression is well-formed, otherwise returns \fI__rhs\fP .PP Definition at line 397 of file bits/alloc_traits\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.