sparrow 1.0.0
Loading...
Searching...
No Matches
sparrow::detail::holder< T > Class Template Reference

A holder class that wraps a value and provides storage management. More...

#include <u8_buffer.hpp>

Collaboration diagram for sparrow::detail::holder< T >:
[legend]

Public Types

using inner_type = T
 

Public Member Functions

template<class... Args>
constexpr holder (Args &&... args) noexcept
 Constructs a holder with the given arguments forwarded to the wrapped value.
 
constexpr T extract_storage () &&noexcept
 Extracts the storage by moving the wrapped value.
 
constexpr const T & storage () const noexcept
 Gets a constant reference to the storage.
 
constexpr T & storage () noexcept
 Gets a reference to the storage.
 
constexpr void assign (T &&other)
 Assigns a new value to the storage.
 

Public Attributes

value
 

Detailed Description

template<class T>
class sparrow::detail::holder< T >

A holder class that wraps a value and provides storage management.

Template Parameters
TThe type of the value to hold.

Definition at line 36 of file u8_buffer.hpp.

Member Typedef Documentation

◆ inner_type

template<class T>
using sparrow::detail::holder< T >::inner_type = T

Definition at line 40 of file u8_buffer.hpp.

Constructor & Destructor Documentation

◆ holder()

template<class T>
template<class... Args>
sparrow::detail::holder< T >::holder ( Args &&... args)
inlineconstexprnoexcept

Constructs a holder with the given arguments forwarded to the wrapped value.

Template Parameters
ArgsThe argument types.
Parameters
argsArguments to forward to the value constructor.

Definition at line 49 of file u8_buffer.hpp.

Member Function Documentation

◆ assign()

template<class T>
void sparrow::detail::holder< T >::assign ( T && other)
inlineconstexpr

Assigns a new value to the storage.

Parameters
otherThe value to assign.

Definition at line 91 of file u8_buffer.hpp.

◆ extract_storage()

template<class T>
T sparrow::detail::holder< T >::extract_storage ( ) &&
inlinenodiscardconstexprnoexcept

Extracts the storage by moving the wrapped value.

Returns
The moved storage value.

Definition at line 61 of file u8_buffer.hpp.

◆ storage() [1/2]

template<class T>
const T & sparrow::detail::holder< T >::storage ( ) const
inlinenodiscardconstexprnoexcept

Gets a constant reference to the storage.

Returns
Constant reference to the storage.

Definition at line 71 of file u8_buffer.hpp.

◆ storage() [2/2]

template<class T>
T & sparrow::detail::holder< T >::storage ( )
inlinenodiscardconstexprnoexcept

Gets a reference to the storage.

Returns
Reference to the storage.

Definition at line 81 of file u8_buffer.hpp.

Member Data Documentation

◆ value

template<class T>
T sparrow::detail::holder< T >::value

Definition at line 54 of file u8_buffer.hpp.


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