Async++ unknown
Async (co_await/co_return) code for C++
Loading...
Searching...
No Matches
asyncpp::promise< void > Class Reference

Promise type that allows waiting for a result in both synchronous and asynchronous code. More...

#include <asyncpp/promise.h>

Inheritance diagram for asyncpp::promise< void >:
[legend]

Public Types

using result_type = void
 

Public Member Functions

 promise ()=default
 Construct a new promise object in its pending state.
 
 promise (const promise &other)=default
 Copy constructor.
 
promiseoperator= (const promise &other)=default
 Copy assignment.
 
void fulfill ()
 
bool try_fulfill ()
 
void then (std::function< void()> then_cb, std::function< void(const std::exception_ptr &)> catch_cb)
 
void get () const
 
template<class Rep , class Period >
bool get (std::chrono::duration< Rep, Period > timeout) const
 
std::pair< bool, std::exception_ptr > try_get (std::nothrow_t) const noexcept
 
bool try_get () const
 
auto operator co_await () const noexcept
 

Static Public Member Functions

static promise make_fulfilled ()
 
static promise make_rejected (std::exception_ptr exception)
 
template<typename TException , typename... Args>
static promise make_rejected (Args &&... args)
 

Detailed Description

Promise type that allows waiting for a result in both synchronous and asynchronous code.

Template Parameters
TResultType of the result

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