|
Foundation
|
std::allocator adaptor for Foundation::Core::Allocator
More...
#include <Allocator.hpp>
Classes | |
| struct | Rebind |
Public Types | |
| using | value_type = T |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | pointer = T * |
| using | const_pointer = const T * |
| using | reference = T & |
| using | const_reference = const T & |
Public Member Functions | |
| StlAllocator (Allocator *resource) noexcept | |
| template<typename U > | |
| StlAllocator (const StlAllocator< U > &other) noexcept | |
| pointer | allocate (size_type n) |
| void | deallocate (pointer p, size_type n) noexcept |
| void | deallocate (pointer p) noexcept |
Private Attributes | |
| Allocator * | mResource |
Friends | |
| template<typename U > | |
| class | StlAllocator |
| bool | operator== (const StlAllocator &lhs, const StlAllocator &rhs) noexcept |
| bool | operator!= (const StlAllocator &lhs, const StlAllocator &rhs) noexcept |
std::allocator adaptor for Foundation::Core::Allocator
Construction without a Foundation::Core::Allocator pointer is disallowed, and will result in a compile-time error. For STL types that require default-constructible allocators, use StlAllocator<void> and pass the resource explicitly
Rebind construction is supported.
Using this with e.g. Foundation::Core::Vector can be done as follows:
| using Foundation::Core::StlAllocator< T >::difference_type = std::ptrdiff_t |
| using Foundation::Core::StlAllocator< T >::size_type = std::size_t |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
friend |
|
friend |
|
private |