Add a promise mock

This commit is contained in:
Denis Blank 2017-03-18 02:10:14 +01:00
parent 2de2f8d6d9
commit 6d9680905a
2 changed files with 17 additions and 1 deletions

View File

@ -1334,7 +1334,7 @@ constexpr auto common_result_of(Signature signature, signature_hint_tag<>,
/// Determine the common result between all continuation which are chained
/// with an `any` strategy, consider two continuations:
/// c1 with `void(int)` and c22 with `void(float)`, the common result shared
/// c1 with `void(int)` and c2 with `void(float)`, the common result shared
/// between both continuations is `void(int)`.
template <typename Signature, typename First, typename... Args>
constexpr auto common_result_of(Signature signature, First first,

View File

@ -55,6 +55,22 @@ template <typename... T> struct promise {
bool is_canceled() const noexcept { return false; }
};
template <typename... T> struct promise {
void set_value(T...) noexcept {}
void operator()(T...) && noexcept {}
void set_exception(std::exception_ptr exception) noexcept {
// ...
(void)exception;
}
void set_error(std::error_code error) noexcept {
// ...
(void)error;
}
};
template <typename... Result> struct accumulator {
auto accumulate() {
return [] {};