mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
Add a promise mock
This commit is contained in:
parent
2de2f8d6d9
commit
6d9680905a
@ -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,
|
||||
|
||||
@ -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 [] {};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user