Sequoia
|
Base class for use with both plain (shared counting) allocators and std::scoped_allocator_adaptor. More...
#include <AllocationCheckers.hpp>
Public Types | |
using | allocator_type = std::invoke_result_t< Getter, T > |
Public Member Functions | |
constexpr | allocation_info_base (Getter allocGetter) |
constexpr | allocation_info_base (const allocation_info_base &)=default |
int | count (const T &c) const noexcept |
template<class... Args> | |
allocator_type | make_allocator (Args &&... args) const |
allocator_type | allocator (const T &c) const |
Protected Member Functions | |
constexpr | allocation_info_base (allocation_info_base &&) noexcept=default |
constexpr allocation_info_base & | operator= (const allocation_info_base &)=default |
constexpr allocation_info_base & | operator= (allocation_info_base &&) noexcept=default |
constexpr Getter | make_getter () const |
Base class for use with both plain (shared counting) allocators and std::scoped_allocator_adaptor.
This class wraps one of the essential ingredients for allocation testing: a function object which can acquire a copy of a container's allocator. Note that a container with multiple independent allocators will generally be associated with multiple instantiations of this class. (Each of these independent allocators may be scoped.)
The class is designed for inheritance but not for the purpose of type erasure and so has a protected destructor etc.