.TH "std::allocator_traits< _Alloc >" 3 "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::allocator_traits< _Alloc > \- Uniform interface to all allocator types\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherited by \fB__gnu_cxx::__alloc_traits< _Char_alloc_type >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::__alloc_traits< _CharT_alloc_type >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::__alloc_traits< _Node_alloc_type >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::__alloc_traits< _Bit_alloc_type >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::__alloc_traits< _Tp_alloc_type >\fP, \fB__gnu_cxx::__alloc_traits< _Map_alloc_type >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::__alloc_traits< _Pair_alloc_type >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::__alloc_traits< _Key_alloc_type >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::__alloc_traits< _Val_alloc_type >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::__alloc_traits< _Node_allocator >\fP, \fB__gnu_cxx::pointer< _Tp_alloc_type >\fP, \fB__gnu_cxx::__alloc_traits< allocator_type >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::other< _Alloc >\fP, \fB__gnu_cxx::__alloc_traits< std::allocator< value_type > >\fP, and \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" .br .RI "The allocator's const pointer type\&. " .ti -1c .RI "using \fBconst_void_pointer\fP" .br .RI "The allocator's const void pointer type\&. " .ti -1c .RI "using \fBdifference_type\fP" .br .RI "The allocator's difference type\&. " .ti -1c .RI "using \fBis_always_equal\fP" .br .RI "Whether all instances of the allocator type compare equal\&. " .ti -1c .RI "using \fBpointer\fP" .br .RI "The allocator's pointer type\&. " .ti -1c .RI "using \fBpropagate_on_container_copy_assignment\fP" .br .RI "How the allocator is propagated on copy assignment\&. " .ti -1c .RI "using \fBpropagate_on_container_move_assignment\fP" .br .RI "How the allocator is propagated on move assignment\&. " .ti -1c .RI "using \fBpropagate_on_container_swap\fP" .br .RI "How the allocator is propagated on swap\&. " .ti -1c .RI "template using \fBrebind_alloc\fP" .br .ti -1c .RI "template using \fBrebind_traits\fP" .br .ti -1c .RI "using \fBsize_type\fP" .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" .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 .br requires __can_construct<_Alloc, _Tp, _Args\&.\&.\&.>static constexpr void \fBconstruct\fP (_Alloc &__a, _Tp *__p, _Args &&\&.\&.\&. __args) noexcept(_S_nothrow_construct< _Tp, _Args\&.\&.\&. >())" .br .RI "Construct an object of type \fR_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(_S_nothrow_destroy< _Tp >())" .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 .SH "Detailed Description" .PP .SS "template .br struct std::allocator_traits< _Alloc >"Uniform interface to all allocator types\&. .PP \fBSince\fP .RS 4 C++11 .RE .PP .SH "Member Typedef Documentation" .PP .SS "template typedef _Alloc \fBstd::allocator_traits\fP< _Alloc >::allocator_type" .PP The allocator type\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::const_pointer" .PP The allocator's const pointer type\&. \fRAlloc::const_pointer\fP if that type exists, otherwise \fR pointer_traits::rebind \fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::const_void_pointer" .PP The allocator's const void pointer type\&. \fRAlloc::const_void_pointer\fP if that type exists, otherwise \fR pointer_traits::rebind \fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::difference_type" .PP The allocator's difference type\&. \fRAlloc::difference_type\fP if that type exists, otherwise \fR pointer_traits::difference_type \fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::is_always_equal" .PP Whether all instances of the allocator type compare equal\&. \fRAlloc::is_always_equal\fP if that type exists, otherwise \fRis_empty::type\fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::pointer" .PP The allocator's pointer type\&. \fRAlloc::pointer\fP if that type exists, otherwise \fRvalue_type*\fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::propagate_on_container_copy_assignment" .PP How the allocator is propagated on copy assignment\&. \fRAlloc::propagate_on_container_copy_assignment\fP if that type exists, otherwise \fRfalse_type\fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::propagate_on_container_move_assignment" .PP How the allocator is propagated on move assignment\&. \fRAlloc::propagate_on_container_move_assignment\fP if that type exists, otherwise \fRfalse_type\fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::propagate_on_container_swap" .PP How the allocator is propagated on swap\&. \fRAlloc::propagate_on_container_swap\fP if that type exists, otherwise \fRfalse_type\fP .SS "template using \fBstd::allocator_traits\fP< _Alloc >::size_type" .PP The allocator's size type\&. \fRAlloc::size_type\fP if that type exists, otherwise \fR make_unsigned::type \fP .SS "template typedef _Alloc::value_type \fBstd::allocator_traits\fP< _Alloc >::value_type" .PP The allocated type\&. .SS "template using \fBstd::allocator_traits\fP< _Alloc >::void_pointer" .PP The allocator's void pointer type\&. \fRAlloc::void_pointer\fP if that type exists, otherwise \fR pointer_traits::rebind \fP .SH "Member Function Documentation" .PP .SS "template constexpr \fBpointer\fP \fBstd::allocator_traits\fP< _Alloc >::allocate (_Alloc & __a, \fBsize_type\fP __n)\fR [inline]\fP, \fR [static]\fP, \fR [nodiscard]\fP, \fR [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 \fRa\&.allocate(n)\fP .SS "template constexpr \fBpointer\fP \fBstd::allocator_traits\fP< _Alloc >::allocate (_Alloc & __a, \fBsize_type\fP __n, \fBconst_void_pointer\fP __hint)\fR [inline]\fP, \fR [static]\fP, \fR [nodiscard]\fP, \fR [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 \fRvalue_type\fP .RE .PP Returns \fR a\&.allocate(n, hint) \fP if that expression is well-formed, otherwise returns \fRa\&.allocate(n)\fP .SS "template template .br requires __can_construct<_Alloc, _Tp, _Args\&.\&.\&.>constexpr void \fBstd::allocator_traits\fP< _Alloc >::construct (_Alloc & __a, _Tp * __p, _Args &&\&.\&.\&. __args)\fR [inline]\fP, \fR [static]\fP, \fR [constexpr]\fP, \fR [noexcept]\fP" .PP Construct an object of type \fR_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 \fR __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 constexpr void \fBstd::allocator_traits\fP< _Alloc >::deallocate (_Alloc & __a, \fBpointer\fP __p, \fBsize_type\fP __n)\fR [inline]\fP, \fR [static]\fP, \fR [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 \fR a\&.deallocate(p, n) \fP .SS "template template constexpr void \fBstd::allocator_traits\fP< _Alloc >::destroy (_Alloc & __a, _Tp * __p)\fR [inline]\fP, \fR [static]\fP, \fR [constexpr]\fP, \fR [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 \fR__a\&.destroy(__p)\fP if that expression is well-formed, otherwise calls \fR__p->~_Tp()\fP .SS "template constexpr \fBsize_type\fP \fBstd::allocator_traits\fP< _Alloc >::max_size (const _Alloc & __a)\fR [inline]\fP, \fR [static]\fP, \fR [constexpr]\fP, \fR [noexcept]\fP" .PP The maximum supported allocation size\&. .PP \fBParameters\fP .RS 4 \fI__a\fP An allocator\&. .RE .PP \fBReturns\fP .RS 4 \fR__a\&.max_size()\fP or \fRnumeric_limits::max()\fP .RE .PP Returns \fR__a\&.max_size()\fP if that expression is well-formed, otherwise returns \fRnumeric_limits::max()\fP .SS "template constexpr _Alloc \fBstd::allocator_traits\fP< _Alloc >::select_on_container_copy_construction (const _Alloc & __rhs)\fR [inline]\fP, \fR [static]\fP, \fR [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 \fR__rhs\&.select_on_container_copy_construction()\fP or \fI__rhs\fP .RE .PP Returns \fR__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\&.