memory
Typedefs | Member Functions
reference_storage< any_allocator > Class Reference

Detailed Description

Specialization of the class template reference_storage that is type-erased.

It is triggered by the tag type any_allocator. The specialization can store a reference to any allocator type.

Typedefs

using allocator_type = implementation_defined
 

Member Functions

template<class RawAllocator >
 reference_storage (RawAllocator &alloc) noexcept
 
template<class RawAllocator >
 reference_storage (const RawAllocator &alloc,) noexcept
 It will not store anything, only creates the allocator as needed.
 
 reference_storage (const implementation_defined &alloc) noexcept
 
 reference_storage (implementation_defined &alloc) noexcept
 
allocator_type & get_allocator () const noexcept
 
 reference_storage (const reference_storage &other) noexcept
 
reference_storageoperator= (const reference_storage &other) noexcept
 

Constructors

◆ reference_storage() [1/5]

reference_storage ( RawAllocator &  alloc)
noexcept
Effects:
Creates it from a reference to any stateful RawAllocator. It will store a pointer to this allocator object.
Note
The user has to take care that the lifetime of the reference does not exceed the allocator lifetime.

◆ reference_storage() [2/5]

reference_storage ( const RawAllocator &  alloc)
noexcept

It will not store anything, only creates the allocator as needed.

Requires:
The RawAllocator is stateless.

◆ reference_storage() [3/5]

reference_storage ( const implementation_defined &  alloc)
noexcept
Effects:
Creates it from the internal base class for the type-erasure. Has the same effect as if the actual stored allocator were passed to the other constructor overloads.
Note
This constructor is used internally to avoid double-nesting.

◆ reference_storage() [4/5]

reference_storage ( implementation_defined &  alloc)
noexcept
Effects:
Creates it from the internal base class for the type-erasure. Has the same effect as if the actual stored allocator were passed to the other constructor overloads.
Note
This constructor is used internally to avoid double-nesting.

◆ reference_storage() [5/5]

reference_storage ( const reference_storage< any_allocator > &  other)
noexcept
Effects:
Copies the reference_storage object. It only copies the pointer to the allocator.

Member Functions

◆ operator=()

reference_storage & operator= ( const reference_storage< any_allocator > &  other)
noexcept
Effects:
Copies the reference_storage object. It only copies the pointer to the allocator.

◆ get_allocator()

allocator_type & get_allocator ( ) const
noexcept
Returns:
A reference to the allocator. The actual type is implementation-defined since it is the base class used in the type-erasure, but it provides the full RawAllocator member functions.
Note
There is no way to access any custom member functions of the allocator type.