Sequoia
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
sequoia::testing::allocation_info_base< T, Getter > Class Template Reference

Base class for use with both plain (shared counting) allocators and std::scoped_allocator_adaptor. More...

#include <AllocationCheckers.hpp>

Inheritance diagram for sequoia::testing::allocation_info_base< T, Getter >:
sequoia::testing::allocation_info< T, Getter > sequoia::testing::allocation_info< T, Getter >

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_baseoperator= (const allocation_info_base &)=default
 
constexpr allocation_info_baseoperator= (allocation_info_base &&) noexcept=default
 
constexpr Getter make_getter () const
 

Detailed Description

template<movable_comparable T, alloc_getter< T > Getter>
class sequoia::testing::allocation_info_base< T, Getter >

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.


The documentation for this class was generated from the following file: