memory
Typedefs | Member Functions
direct_storage< RawAllocator > Class Template Reference

Detailed Description

template<class RawAllocator>
class foonathan::memory::direct_storage< RawAllocator >

A StoragePolicy that stores the allocator directly.

It embeds the allocator inside it, i.e. moving the storage policy will move the allocator.

Typedefs

using allocator_type = typename allocator_traits< RawAllocator >::allocator_type
 

Member Functions

 direct_storage ()=default
 
 direct_storage (allocator_type &&allocator) noexcept
 
 direct_storage (direct_storage &&other) noexcept
 
direct_storageoperator= (direct_storage &&other) noexcept
 
allocator_type & get_allocator () noexcept
 
const allocator_type & get_allocator () const noexcept
 

Constructors

◆ direct_storage() [1/3]

direct_storage ( )
default
Effects:
Creates it by default-constructing the allocator.
Requires:
The RawAllcoator must be default constructible.

◆ direct_storage() [2/3]

direct_storage ( allocator_type &&  allocator)
noexcept
Effects:
Creates it by moving in an allocator object.

◆ direct_storage() [3/3]

direct_storage ( direct_storage< RawAllocator > &&  other)
noexcept
Effects:
Moves the direct_storage object. This will move the stored allocator.

Member Functions

◆ operator=()

direct_storage & operator= ( direct_storage< RawAllocator > &&  other)
noexcept
Effects:
Moves the direct_storage object. This will move the stored allocator.

◆ get_allocator() [1/2]

allocator_type & get_allocator ( )
noexcept
Returns:
A (const) reference to the stored allocator.

◆ get_allocator() [2/2]

const allocator_type & get_allocator ( ) const
noexcept
Returns:
A (const) reference to the stored allocator.