template<typename Data, typename Hint>
promise_base class
The promise_
Contents
Use the promise type defined in continuable/continuable_types.hpp
, in order to use this class.
If we want to resolve the promise_
Constructors, destructors, conversion operators
- promise_base() defaulted explicit
- Constructor for constructing an empty promise.
- promise_base(Data data) explicit
- Constructor accepting the data object.
-
template<typename OData, std::enable_if_t<std::is_convertible<detail::traits::unrefcv_t<OData>, Data>::value>* = nullptr>promise_base(OData&& data)
- Constructor accepting any object convertible to the data object.
- operator bool() const explicit noexcept
- Returns true if the continuation is valid (non empty).
Public functions
-
template<typename OData, std::enable_if_t<std::is_convertible<detail::traits::unrefcv_t<OData>, Data>::value>* = nullptr>auto operator=(OData&& data) -> promise_
base& - Assignment operator accepting any object convertible to the data object.
- void operator()(Args... args) &&noexcept
- Resolves the continuation with the given values.
-
void operator()(exception_
arg_ t tag, exception_ t exception) &&noexcept - Resolves the continuation with the given exception.
- void set_value(Args... args) noexcept
- Resolves the continuation with the given values.
-
void set_exception(exception_
t exception) noexcept - Resolves the continuation with the given exception.
- void set_canceled() noexcept
- Resolves the continuation with the cancellation token which is represented by a default constructed exception_t.
Function documentation
template<typename Data, typename Hint>
cti:: promise_base<Data, Hint>:: operator bool() const explicit noexcept
Returns true if the continuation is valid (non empty).
Exceptions | |
---|---|
This | method never throws an exception. |
template<typename Data, typename Hint>
void cti:: promise_base<Data, Hint>:: operator()(Args... args) &&noexcept
Resolves the continuation with the given values.
Exceptions | |
---|---|
This | method never throws an exception. |
template<typename Data, typename Hint>
void cti:: promise_base<Data, Hint>:: operator()(exception_ arg_ t tag,
exception_ t exception) &&noexcept
Resolves the continuation with the given exception.
Exceptions | |
---|---|
This | method never throws an exception. |
template<typename Data, typename Hint>
void cti:: promise_base<Data, Hint>:: set_value(Args... args) noexcept
Resolves the continuation with the given values.
Exceptions | |
---|---|
This | method never throws an exception. |
template<typename Data, typename Hint>
void cti:: promise_base<Data, Hint>:: set_exception(exception_ t exception) noexcept
Resolves the continuation with the given exception.
Exceptions | |
---|---|
This | method never throws an exception. |
template<typename Data, typename Hint>
void cti:: promise_base<Data, Hint>:: set_canceled() noexcept
Resolves the continuation with the cancellation token which is represented by a default constructed exception_t.
Exceptions | |
---|---|
This | method never throws an exception. |