memory
|
Wraps a RawAllocator and makes it a "normal" Allocator
.
It allows using a RawAllocator
anywhere a Allocator
is required.
Member Functions | |
std_allocator () noexcept | |
template<class RawAlloc > | |
std_allocator (RawAlloc &alloc,) noexcept | |
template<class RawAlloc > | |
std_allocator (const RawAlloc &alloc,) noexcept | |
std_allocator (const alloc_reference &alloc) noexcept | |
template<class StoragePolicy , class OtherMut > | |
std_allocator (const allocator_storage< StoragePolicy, OtherMut > &)=delete | |
std_allocator< T, RawAllocator > | select_on_container_copy_construction () const |
pointer | allocate (size_type n, void *=nullptr) |
void | deallocate (pointer p, size_type n) noexcept |
template<typename U , typename... Args> | |
void | construct (U *p, Args &&... args) |
template<typename U > | |
void | destroy (U *p) noexcept |
size_type | max_size () const noexcept |
template<typename U > | |
std_allocator (const std_allocator< U, RawAllocator > &alloc) noexcept | |
template<typename U > | |
std_allocator (std_allocator< U, RawAllocator > &alloc) noexcept | |
auto | get_allocator () noexcept -> decltype(std::declval< alloc_reference >().get_allocator()) |
auto | get_allocator () const noexcept -> decltype(std::declval< const alloc_reference >().get_allocator()) |
Related Functions | |
template<typename T , typename U , class Impl > | |
bool | operator== (const std_allocator< T, Impl > &lhs, const std_allocator< U, Impl > &rhs) noexcept |
template<typename T , typename U , class Impl > | |
bool | operator!= (const std_allocator< T, Impl > &lhs, const std_allocator< U, Impl > &rhs) noexcept |
template<typename T , class RawAllocator > | |
auto | make_std_allocator (RawAllocator &&allocator) noexcept -> std_allocator< T, typename std::decay< RawAllocator >::type > |
|
noexcept |
RawAllocator
inside the reference. RawAllocator
type is stateless, otherwise the body of this function will not compile.
|
noexcept |
RawAllocator
. It will store an allocator_reference to it. allocator_reference<RawAllocator>(alloc)
is well-formed, that is either RawAlloc
is the same as RawAllocator
or RawAllocator
is the tag type any_allocator. If the requirement is not fulfilled this function does not participate in overload resolution. RawAllocator
is at least as long as the lifetime of this std_allocator object.
|
noexcept |
RawAllocator
object. It will not store a reference but create it on the fly. RawAllocator
is stateless and the expression allocator_reference<RawAllocator>(alloc)
is well-formed as above, otherwise this function does not participate in overload resolution.
|
noexcept |
|
delete |
Implicit conversion from any other allocator_storage is forbidden to prevent accidentally wrapping another allocator_storage inside a allocator_reference.
|
noexcept |
Allcoator
concept and simply takes the same allocator_reference.
|
noexcept |
Allcoator
concept and simply takes the same allocator_reference. std_allocator< T, RawAllocator > select_on_container_copy_construction | ( | ) | const |
Allocator
concept and forwards to the propagation_traits. pointer allocate | ( | size_type | n, |
void * | = nullptr |
||
) |
n
is 1
, it will call allocate_node(sizeof(T), alignof(T))
, otherwise allocate_array(n, sizeof(T), alignof(T))
. n
objects of type T
. RawAllocator
.
|
noexcept |
n
on this object or any copy of it. void construct | ( | U * | p, |
Args &&... | args | ||
) |
U
at given address using the passed arguments.
|
noexcept |
U
at given address.
|
noexcept |
max_array_size() / sizeof(value_type)
. This is only an upper bound, not the exact maximum.
|
noexcept |
const
) reference to the stored allocator. For stateless allocators: A temporary constructed allocator.
|
noexcept |
const
) reference to the stored allocator. For stateless allocators: A temporary constructed allocator.
|
related |
|
related |
|
related |