Variadic Futures
Public Types | Public Member Functions | List of all members
aom::Basic_promise< Alloc, Ts > Class Template Reference

Landing for a value that finishes a Future. More...

#include <future.h>

Public Types

using future_type = Basic_future< Alloc, Ts... >
 
using storage_type = typename future_type::storage_type
 
using value_type = detail::future_value_type_t< Ts... >
 
using fullfill_type = detail::fullfill_type_t< Ts... >
 
using finish_type = detail::finish_type_t< Ts... >
 
using fail_type = detail::fail_type_t< Ts... >
 

Public Member Functions

 Basic_promise (const Alloc &alloc=Alloc())
 
 Basic_promise (Basic_promise &&)=default
 
Basic_promiseoperator= (Basic_promise &&)=default
 
future_type get_future ()
 Get the future object. More...
 
template<typename... Us>
void set_value (Us &&... values)
 Fullfills the promise. More...
 
template<typename... Us>
void finish (Us &&... expecteds)
 Finishes the promise. More...
 
void set_exception (fail_type error)
 Fails the promise. More...
 
 operator bool () const
 returns wether the promise still refers to an uncompleted future More...
 

Detailed Description

template<typename Alloc, typename... Ts>
class aom::Basic_promise< Alloc, Ts >

Landing for a value that finishes a Future.

Template Parameters
Ts

Member Function Documentation

◆ finish()

template<typename Alloc , typename... Ts>
template<typename... Us>
void aom::Basic_promise< Alloc, Ts >::finish ( Us &&...  expecteds)

Finishes the promise.

Template Parameters
Us
Parameters
expecteds

◆ get_future()

template<typename Alloc , typename... Ts>
future_type aom::Basic_promise< Alloc, Ts >::get_future ( )

Get the future object.

Parameters
allocThe allocator to use when creating the interal state
Returns
future_type

◆ operator bool()

template<typename Alloc , typename... Ts>
aom::Basic_promise< Alloc, Ts >::operator bool ( ) const

returns wether the promise still refers to an uncompleted future

Returns
true
false

◆ set_exception()

template<typename Alloc , typename... Ts>
void aom::Basic_promise< Alloc, Ts >::set_exception ( fail_type  error)

Fails the promise.

Parameters
error

◆ set_value()

template<typename Alloc , typename... Ts>
template<typename... Us>
void aom::Basic_promise< Alloc, Ts >::set_value ( Us &&...  values)

Fullfills the promise.

Template Parameters
Us
Parameters
values

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