diff --git a/include/continuable/continuable-transforms.hpp b/include/continuable/continuable-transforms.hpp index 4373154..6938e93 100644 --- a/include/continuable/continuable-transforms.hpp +++ b/include/continuable/continuable-transforms.hpp @@ -48,7 +48,7 @@ namespace cti { /// | `continuable_base with ` | `std::future` | /// | `continuable_base with ` | `std::future>` | /// -/// \alert If exceptions are used, exceptions that are thrown are forwarded +/// \alert If exceptions are used, exceptions that are thrown, are forwarded /// to the returned future. If there are no exceptions supported, /// you shall not pass any errors to the end of the asynchronous /// call chain! diff --git a/test/mock/test-mock.cpp b/test/mock/test-mock.cpp index 5030115..6fe1f7a 100644 --- a/test/mock/test-mock.cpp +++ b/test/mock/test-mock.cpp @@ -25,22 +25,48 @@ #include #include -template struct continuable { - template continuable(T&& = 0) {} +template +struct continuable { + template + continuable(T&& = 0) { + } - template continuable& then(T&&) { return *this; } + template + continuable& then(T&&) { + return *this; + } - template continuable& dropped(T&&) { return *this; } + template + continuable& dropped(T&&) { + return *this; + } - template continuable& thrown(T&&) { return *this; } + template + continuable& thrown(T&&) { + return *this; + } - template continuable& failed(T&&) { return *this; } + template + continuable& failed(T&&) { + return *this; + } + + template + continuable& operator|(T&&) { + return *this; + } }; -template struct promise { - void set_value(A...) noexcept {} +template +using channel = continuable; - void operator()(A...) && noexcept {} +template +struct promise { + void set_value(A...) noexcept { + } + + void operator()(A...) && noexcept { + } void set_exception(std::exception_ptr exception) noexcept { // ... @@ -52,12 +78,16 @@ template struct promise { (void)error; } - void cancel() noexcept {} + void cancel() noexcept { + } - bool is_canceled() const noexcept { return false; } + bool is_canceled() const noexcept { + return false; + } }; -template struct accumulator { +template +struct accumulator { auto accumulate() { return [] {}; }