YOrch 1.0.0
Loading...
Searching...
No Matches
yorch::detail::maybe_storage< T > Struct Template Reference

Manual-lifetime storage for an optional in-place T. More...

#include <maybe_storage.hpp>

Public Member Functions

constexpr maybe_storage () noexcept=default
 
constexpr maybe_storage (const maybe_storage &other) noexcept(std::is_nothrow_copy_constructible_v< T >)
 
constexpr maybe_storage (const maybe_storage &)=delete
 
constexpr maybe_storage (maybe_storage &&other) noexcept(std::is_nothrow_move_constructible_v< T >)
 
constexpr maybe_storage (maybe_storage &&)=delete
 
constexpr maybe_storageoperator= (const maybe_storage &other) noexcept(assign_from_nothrow_v< const maybe_storage & >)
 
constexpr maybe_storageoperator= (const maybe_storage &)=delete
 
constexpr maybe_storageoperator= (maybe_storage &&other) noexcept(assign_from_nothrow_v< maybe_storage && >)
 
constexpr maybe_storageoperator= (maybe_storage &&)=delete
 
 ~maybe_storage ()
 
template<typename... Args>
constexpr Templace (Args &&... args) noexcept(std::is_nothrow_constructible_v< T, Args &&... >)
 
constexpr void destroy () noexcept
 
constexpr bool has_value () const noexcept
 
constexpr Tget () &noexcept
 
constexpr const Tget () const &noexcept
 
constexpr T && get () &&noexcept
 
constexpr Traw_ptr () noexcept
 
constexpr const Traw_ptr () const noexcept
 
constexpr boolengaged_ptr () noexcept
 
constexpr const boolengaged_ptr () const noexcept
 

Detailed Description

template<typename T>
struct yorch::detail::maybe_storage< T >

Manual-lifetime storage for an optional in-place T.

This helper underpins both public task-return wrappers and per-plan typed slots. It owns raw storage plus an engagement flag, then explicitly starts and ends T's lifetime via emplace(...) and destroy().

Template Parameters
TStored non-reference, non-void object type.

Definition at line 23 of file maybe_storage.hpp.

Constructor & Destructor Documentation

◆ maybe_storage() [1/5]

template<typename T >
constexpr yorch::detail::maybe_storage< T >::maybe_storage ( )
constexprdefaultnoexcept

◆ maybe_storage() [2/5]

template<typename T >
constexpr yorch::detail::maybe_storage< T >::maybe_storage ( const maybe_storage< T > &  other)
inlineconstexprnoexcept

Definition at line 32 of file maybe_storage.hpp.

◆ maybe_storage() [3/5]

template<typename T >
constexpr yorch::detail::maybe_storage< T >::maybe_storage ( const maybe_storage< T > &  )
constexprdelete

◆ maybe_storage() [4/5]

template<typename T >
constexpr yorch::detail::maybe_storage< T >::maybe_storage ( maybe_storage< T > &&  other)
inlineconstexprnoexcept

Definition at line 45 of file maybe_storage.hpp.

◆ maybe_storage() [5/5]

template<typename T >
constexpr yorch::detail::maybe_storage< T >::maybe_storage ( maybe_storage< T > &&  )
constexprdelete

◆ ~maybe_storage()

Definition at line 92 of file maybe_storage.hpp.

Member Function Documentation

◆ destroy()

template<typename T >
constexpr void yorch::detail::maybe_storage< T >::destroy ( )
inlineconstexprnoexcept

Definition at line 108 of file maybe_storage.hpp.

◆ emplace()

template<typename T >
template<typename... Args>
constexpr T & yorch::detail::maybe_storage< T >::emplace ( Args &&...  args)
inlineconstexprnoexcept

Definition at line 97 of file maybe_storage.hpp.

◆ engaged_ptr() [1/2]

template<typename T >
constexpr const bool * yorch::detail::maybe_storage< T >::engaged_ptr ( ) const
inlineconstexprnoexcept

Definition at line 151 of file maybe_storage.hpp.

◆ engaged_ptr() [2/2]

template<typename T >
constexpr bool * yorch::detail::maybe_storage< T >::engaged_ptr ( )
inlineconstexprnoexcept

Definition at line 147 of file maybe_storage.hpp.

◆ get() [1/3]

template<typename T >
constexpr T && yorch::detail::maybe_storage< T >::get ( ) &&
inlineconstexprnoexcept

Definition at line 133 of file maybe_storage.hpp.

◆ get() [2/3]

template<typename T >
constexpr T & yorch::detail::maybe_storage< T >::get ( ) &
inlineconstexprnoexcept

Definition at line 121 of file maybe_storage.hpp.

◆ get() [3/3]

template<typename T >
constexpr const T & yorch::detail::maybe_storage< T >::get ( ) const &
inlineconstexprnoexcept

Definition at line 127 of file maybe_storage.hpp.

◆ has_value()

template<typename T >
constexpr bool yorch::detail::maybe_storage< T >::has_value ( ) const
inlineconstexprnoexcept

Definition at line 117 of file maybe_storage.hpp.

◆ operator=() [1/4]

◆ operator=() [2/4]

template<typename T >
constexpr maybe_storage & yorch::detail::maybe_storage< T >::operator= ( const maybe_storage< T > &  other)
inlineconstexprnoexcept

Definition at line 59 of file maybe_storage.hpp.

◆ operator=() [3/4]

◆ operator=() [4/4]

template<typename T >
constexpr maybe_storage & yorch::detail::maybe_storage< T >::operator= ( maybe_storage< T > &&  other)
inlineconstexprnoexcept

Definition at line 75 of file maybe_storage.hpp.

◆ raw_ptr() [1/2]

template<typename T >
constexpr const T * yorch::detail::maybe_storage< T >::raw_ptr ( ) const
inlineconstexprnoexcept

Definition at line 143 of file maybe_storage.hpp.

◆ raw_ptr() [2/2]

template<typename T >
constexpr T * yorch::detail::maybe_storage< T >::raw_ptr ( )
inlineconstexprnoexcept

Definition at line 139 of file maybe_storage.hpp.


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