.TH "__gnu_cxx::__alloc_traits< _Alloc, typename >" 3cxx "Tue Jul 18 2023" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME __gnu_cxx::__alloc_traits< _Alloc, typename > \- Uniform interface to C++98 and C++11 allocators\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBstd::allocator_traits< _Alloc >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef \fBstd::allocator_traits\fP< _Alloc > \fB_Base_type\fP" .br .ti -1c .RI "typedef _Alloc \fBallocator_type\fP" .br .ti -1c .RI "typedef \fB_Base_type::const_pointer\fP \fBconst_pointer\fP" .br .ti -1c .RI "typedef const \fBvalue_type\fP & \fBconst_reference\fP" .br .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 "typedef \fB_Base_type::difference_type\fP \fBdifference_type\fP" .br .ti -1c .RI "using \fBis_always_equal\fP = __detected_or_t< typename is_empty< _Alloc >::type, __equal, _Alloc >" .br .RI "Whether all instances of the allocator type compare equal\&. " .ti -1c .RI "typedef \fB_Base_type::pointer\fP \fBpointer\fP" .br .ti -1c .RI "using \fBpropagate_on_container_copy_assignment\fP = __detected_or_t< false_type, __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< false_type, __pocma, _Alloc >" .br .RI "How the allocator is propagated on move assignment\&. " .ti -1c .RI "using \fBpropagate_on_container_swap\fP = __detected_or_t< false_type, __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 = allocator_traits< rebind_alloc< _Tp > >" .br .ti -1c .RI "typedef \fBvalue_type\fP & \fBreference\fP" .br .ti -1c .RI "typedef \fB_Base_type::size_type\fP \fBsize_type\fP" .br .ti -1c .RI "typedef \fB_Base_type::value_type\fP \fBvalue_type\fP" .br .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 bool \fB_S_always_equal\fP ()" .br .ti -1c .RI "static constexpr bool \fB_S_nothrow_move\fP ()" .br .ti -1c .RI "static constexpr void \fB_S_on_swap\fP (_Alloc &__a, _Alloc &__b)" .br .ti -1c .RI "static constexpr bool \fB_S_propagate_on_copy_assign\fP ()" .br .ti -1c .RI "static constexpr bool \fB_S_propagate_on_move_assign\fP ()" .br .ti -1c .RI "static constexpr bool \fB_S_propagate_on_swap\fP ()" .br .ti -1c .RI "static constexpr _Alloc \fB_S_select_on_copy\fP (const _Alloc &__a)" .br .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)" .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 "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 std::__enable_if_t< __is_custom_pointer< _Ptr >::value > \fBconstruct\fP (_Alloc &__a, _Ptr __p, _Args &&\&.\&.\&. __args) noexcept(noexcept(_Base_type::construct(__a, std::__to_address(__p), \fBstd::forward\fP< _Args >(__args)\&.\&.\&.)))" .br .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 "static constexpr void \fBdeallocate\fP (_Alloc &__a, \fBpointer\fP __p, \fBsize_type\fP __n)" .br .RI "Deallocate memory\&. " .ti -1c .RI "template static constexpr std::__enable_if_t< __is_custom_pointer< _Ptr >::value > \fBdestroy\fP (_Alloc &__a, _Ptr __p) noexcept(noexcept(_Base_type::destroy(__a, std::__to_address(__p))))" .br .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 __gnu_cxx::__alloc_traits< _Alloc, typename >"Uniform interface to C++98 and C++11 allocators\&. .SH "Member Typedef Documentation" .PP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::const_void_pointer = typename _Ptr<__cv_pointer, const void>::type\fC [inherited]\fP" .PP The allocator's const void pointer type\&. \fCAlloc::const_void_pointer\fP if that type exists, otherwise \fC pointer_traits::rebind \fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::is_always_equal = __detected_or_t::type, __equal, _Alloc>\fC [inherited]\fP" .PP Whether all instances of the allocator type compare equal\&. \fCAlloc::is_always_equal\fP if that type exists, otherwise \fCis_empty::type\fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::propagate_on_container_copy_assignment = __detected_or_t\fC [inherited]\fP" .PP How the allocator is propagated on copy assignment\&. \fCAlloc::propagate_on_container_copy_assignment\fP if that type exists, otherwise \fCfalse_type\fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::propagate_on_container_move_assignment = __detected_or_t\fC [inherited]\fP" .PP How the allocator is propagated on move assignment\&. \fCAlloc::propagate_on_container_move_assignment\fP if that type exists, otherwise \fCfalse_type\fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::propagate_on_container_swap = __detected_or_t\fC [inherited]\fP" .PP How the allocator is propagated on swap\&. \fCAlloc::propagate_on_container_swap\fP if that type exists, otherwise \fCfalse_type\fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::void_pointer = typename _Ptr<__v_pointer, void>::type\fC [inherited]\fP" .PP The allocator's void pointer type\&. \fCAlloc::void_pointer\fP if that type exists, otherwise \fC pointer_traits::rebind \fP .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, \fC [inherited]\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 Referenced by \fBstd::__allocate_guarded()\fP\&. .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 .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, \fC [inherited]\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 .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 .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\&.\&.\&. .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, \fC [inherited]\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 Referenced by \fBstd::__allocated_ptr< _Alloc >::~__allocated_ptr()\fP\&. .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 .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 .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 Referenced by \fBstd::forward_list< _Tp, _Alloc >::max_size()\fP, and \fBstd::list< _Tp, _Alloc >::max_size()\fP\&. .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, \fC [inherited]\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 .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.