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

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

Detailed Description

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

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

Definition at line 90 of file storage.h.

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

Public Types

using value_type = T
 

Public Member Functions

void set_exception (std::exception_ptr ptr) noexcept
 
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 Typedef Documentation

◆ value_type

using value_type = T

Definition at line 92 of file storage.h.

Member Function Documentation

◆ set_exception()

void set_exception ( std::exception_ptr  ptr)
inlinenoexcept

Definition at line 93 of file storage.h.

+ Here is the caller graph for this function:

◆ set_value()

void set_value ( U &&  value)
inlinenoexceptinherited

Definition at line 46 of file storage.h.

+ Here is the caller graph for this function:

◆ get() [1/2]

const T & get ( ) const &
inlineinherited

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 ( ) &&
inlineinherited

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
protectedinherited

Definition at line 42 of file storage.h.


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