mp-coro main
Coroutine support tools
Public Member Functions | Protected Attributes | List of all members
storage_base< T > Class Template Reference

#include <mp-coro/bits/storage.h>

Detailed Description

template<typename T>
class mp_coro::detail::storage_base< T >

Storage class that can either contain a value, an exception, or be empty.

Definition at line 40 of file storage.h.

+ Inheritance diagram for storage_base< T >:
+ Collaboration diagram for storage_base< T >:

Public Member Functions

template<std::convertible_to< T > U>
void set_value (U &&value) noexcept(std::is_nothrow_constructible_v< T, decltype(std::forward< U >(value))>)
 
const T & get () const &
 
T && get () &&
 

Protected Attributes

std::variant< std::monostate, std::exception_ptr, T > result
 

Member Function Documentation

◆ set_value()

void set_value ( U &&  value)
inlinenoexcept

Definition at line 46 of file storage.h.

+ Here is the caller graph for this function:

◆ get() [1/2]

const T & get ( ) const &
inline

Definition at line 51 of file storage.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get() [2/2]

T && get ( ) &&
inline

Definition at line 56 of file storage.h.

+ Here is the call graph for this function:

Member Data Documentation

◆ result

std::variant<std::monostate, std::exception_ptr, T> result
protected

Definition at line 42 of file storage.h.


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