![]() |
WPILibC++ 2025.3.2
|
Wraps a RawAllocator and makes it a "normal" Allocator.
More...
#include <wpi/memory/std_allocator.hpp>
Classes | |
| struct | rebind |
Public Types | |
| using | value_type = T |
| using | pointer = T* |
| using | const_pointer = const T* |
| using | reference = T& |
| using | const_reference = const T& |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | propagate_on_container_swap = typename prop_traits::propagate_on_container_swap |
| using | propagate_on_container_move_assignment |
| using | propagate_on_container_copy_assignment |
| using | allocator_type = typename alloc_reference::allocator_type |
Public 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()) |
Friends | |
| template<typename U , class OtherRawAllocator > | |
| class | std_allocator |
| template<typename T1 , typename T2 , class Impl > | |
| bool | operator== (const std_allocator< T1, Impl > &lhs, const std_allocator< T2, Impl > &rhs) noexcept |
Related Symbols | |
(Note that these are not member symbols.) | |
| 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 > |
Wraps a RawAllocator and makes it a "normal" Allocator.
It allows using a RawAllocator anywhere a Allocator is required.
| using wpi::memory::std_allocator< T, RawAllocator >::allocator_type = typename alloc_reference::allocator_type |
| using wpi::memory::std_allocator< T, RawAllocator >::const_pointer = const T* |
| using wpi::memory::std_allocator< T, RawAllocator >::const_reference = const T& |
| using wpi::memory::std_allocator< T, RawAllocator >::difference_type = std::ptrdiff_t |
| using wpi::memory::std_allocator< T, RawAllocator >::pointer = T* |
| using wpi::memory::std_allocator< T, RawAllocator >::propagate_on_container_copy_assignment |
| using wpi::memory::std_allocator< T, RawAllocator >::propagate_on_container_move_assignment |
| using wpi::memory::std_allocator< T, RawAllocator >::propagate_on_container_swap = typename prop_traits::propagate_on_container_swap |
| using wpi::memory::std_allocator< T, RawAllocator >::reference = T& |
| using wpi::memory::std_allocator< T, RawAllocator >::size_type = std::size_t |
| using wpi::memory::std_allocator< T, RawAllocator >::value_type = T |
|
inlinenoexcept |
RawAllocator inside the reference. RawAllocator type is stateless, otherwise the body of this function will not compile.
|
inlinenoexcept |
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.
|
inlinenoexcept |
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.
|
inlinenoexcept |
|
delete |
Implicit conversion from any other allocator_storage is forbidden to prevent accidentally wrapping another allocator_storage inside a allocator_reference.
|
inlinenoexcept |
Allcoator concept and simply takes the same allocator_reference.
|
inlinenoexcept |
|
inline |
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.
|
inline |
U at given address using the passed arguments.
|
inlinenoexcept |
n on this object or any copy of it.
|
inlinenoexcept |
U at given address.
|
inlinenoexcept |
|
inlinenoexcept |
const) reference to the stored allocator. For stateless allocators: A temporary constructed allocator.
|
inlinenoexcept |
max_array_size() / sizeof(value_type). This is only an upper bound, not the exact maximum.
|
inline |
Allocator concept and forwards to the propagation_traits.
|
related |
|
related |
|
related |
|
friend |
|
friend |