|
constexpr | Arena (Resource *resource) noexcept |
| Construct an allocator using the given memory resource, which must be valid. More...
|
|
template<typename D = void, typename = std::enable_if_t<std::is_invocable_r_v<Resource*, DefaultResource>, D>> |
| Arena () |
| Construct an allocator using the resource provided by DefaultResource. More...
|
|
template<typename U > |
constexpr | Arena (Arena< Resource, U, DefaultResource > const &other) noexcept |
| Converting copy constructor, rebinding U -> T. More...
|
|
T * | allocate (std::size_t n) |
| Allocate storage for n objects. More...
|
|
void | deallocate (T *p, std::size_t n) noexcept |
| Deallocate storage for n objects. More...
|
|
Resource * | resource () const noexcept |
| Return a pointer to the memory resource. More...
|
|
template<typename Resource, typename T, typename DefaultResource = void>
class Gaudi::Allocator::Arena< Resource, T, DefaultResource >
Custom allocator holding a pointer to a generic memory resource.
Custom allocator holding a pointer to a memory resource ("arena"). Allocation and deallocation requests are passed through to the arena. Note that the typedefs propagate_on_container_{swap,copy_assignment,move_assignment} do not have their default values.
The, optional, third template parameter (DefaultResource) may be used to specify a default arena, in which case the allocator is default-constructible. Otherwise, a pointer to an arena must be given.
Definition at line 29 of file Arena.h.
template<typename Resource , typename T , typename DefaultResource = void>
template<typename D = void, typename = std::enable_if_t<std::is_invocable_r_v<Resource*, DefaultResource>, D>>
Construct an allocator using the resource provided by DefaultResource.
This constructor is only enabled if an instance of DefaultResource can be invoked with no arguments and yields Resource*.
Definition at line 44 of file Arena.h.
44 :
Arena( std::invoke( DefaultResource{} ) ) {}