WPILibC++ 2025.3.2
Loading...
Searching...
No Matches
wpi::memory::reference_storage< any_allocator > Class Reference

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

#include <wpi/memory/allocator_storage.hpp>

Public Types

using allocator_type = implementation_defined
 

Public 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_typeget_allocator () const noexcept
 
 reference_storage (const reference_storage &other) noexcept
 
reference_storageoperator= (const reference_storage &other) noexcept
 

Protected Member Functions

 ~reference_storage () noexcept
 
bool is_composable () const noexcept
 

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.

Member Typedef Documentation

◆ allocator_type

using wpi::memory::reference_storage< any_allocator >::allocator_type = implementation_defined

Constructor & Destructor Documentation

◆ reference_storage() [1/5]

template<class RawAllocator >
wpi::memory::reference_storage< any_allocator >::reference_storage ( RawAllocator & alloc)
inlinenoexcept
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]

template<class RawAllocator >
wpi::memory::reference_storage< any_allocator >::reference_storage ( const RawAllocator & alloc)
inlinenoexcept

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

Requires:
The RawAllocator is stateless.

◆ reference_storage() [3/5]

wpi::memory::reference_storage< any_allocator >::reference_storage ( const implementation_defined & alloc)
inlinenoexcept
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]

wpi::memory::reference_storage< any_allocator >::reference_storage ( implementation_defined & alloc)
inlinenoexcept
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]

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

◆ ~reference_storage()

Member Function Documentation

◆ get_allocator()

allocator_type & wpi::memory::reference_storage< any_allocator >::get_allocator ( ) const
inlinenoexcept
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.

◆ is_composable()

bool wpi::memory::reference_storage< any_allocator >::is_composable ( ) const
inlineprotectednoexcept

◆ operator=()


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