Kiwaku 0.1-beta
Containers Well Made
 
Loading...
Searching...
No Matches
kwk::any_allocator Struct Reference

Opaque allocator type. More...

#include <kwk/utility/memory/any_allocator.hpp>

Detailed Description

Opaque allocator type.

Model of the kwk::concepts::allocator concept. kwk::any_allocator is a type-erased object able to contains any allocator type modeling kwk::concepts::allocator. It is meant to be used as a non-dependent type in containers or other functions one may want to be non-template

Public Member Functions

 any_allocator ()=default
 Default constructor.
 
 any_allocator (any_allocator &&a)=default
 Move constructor.
 
 any_allocator (any_allocator const &a)
 Copy constructor.
 
template<typename T >
 any_allocator (T &&other)
 Constructor from an arbitrary allocator type.
 
api_t * get () const
 Access to internal allocator pointer.
 
any_allocatoroperator= (any_allocator &&other)=default
 Move assignment operator.
 
any_allocatoroperator= (any_allocator const &other)
 Copy assignment operator.
 
template<typename T >
any_allocatoroperator= (T &&other)
 Assignment from an arbitrary allocator.
 
void swap (any_allocator &other) noexcept
 Swap the contents of two instance of kwk::heap_allocator.