diff --git a/include/continuable/detail/composition-any.hpp b/include/continuable/detail/composition-any.hpp index fa62e63..7eb8570 100644 --- a/include/continuable/detail/composition-any.hpp +++ b/include/continuable/detail/composition-any.hpp @@ -151,7 +151,7 @@ struct continuable_dispatcher { template >::value>* = nullptr> - void operator()(Continuable&& continuable) const { + void operator()(Continuable&& continuable) { // Retrieve a callback from the submitter and attach it to the continuable std::forward(continuable) .next(submitter->create_callback()) diff --git a/test/playground/test-playground.cpp b/test/playground/test-playground.cpp index 0b1ee44..9985663 100644 --- a/test/playground/test-playground.cpp +++ b/test/playground/test-playground.cpp @@ -176,13 +176,4 @@ int main(int, char**) { .then([](int) { }); - - { - container::flat_variant var; - - var = 1; - var = 1.f; - } - - int i = 0; } diff --git a/test/unit-test/multi/test-continuable-connection-all-seq.hpp b/test/unit-test/multi/test-continuable-connection-all-seq.hpp index 0e4b650..63699d0 100644 --- a/test/unit-test/multi/test-continuable-connection-all-seq.hpp +++ b/test/unit-test/multi/test-continuable-connection-all-seq.hpp @@ -75,8 +75,8 @@ void test_all_seq_aggregate(Supplier&& supply, AggregateConnector&& ag) { } { - using type_t = decltype( - std::declval()(std::declval(), std::declval())); + using type_t = std::decay_t()(std::declval(), std::declval()))>; auto chain = ag(std::make_tuple( std::vector{supply(1, 2), supply(3, 4), supply(5, 6)})); diff --git a/test/unit-test/multi/test-continuable-connection-any.cpp b/test/unit-test/multi/test-continuable-connection-any.cpp index c859bb8..d9b457e 100644 --- a/test/unit-test/multi/test-continuable-connection-any.cpp +++ b/test/unit-test/multi/test-continuable-connection-any.cpp @@ -21,6 +21,8 @@ SOFTWARE. **/ +#include + #include TYPED_TEST(single_dimension_tests, is_logical_any_connectable) { @@ -57,6 +59,24 @@ TYPED_TEST(single_dimension_tests, is_logical_any_connectable) { ASSERT_ASYNC_TYPES(std::move(chain), tag1, tag2, tag3); } + { + auto chain = + cti::when_any(std::make_tuple(this->supply(1, 2), + std::make_tuple(this->supply(3, 4))), + this->supply(5, 6)); + EXPECT_ASYNC_RESULT(std::move(chain), 1, 2); + } + + { + using type_t = std::decay_t().supply( + std::declval(), std::declval()))>; + + std::vector v{this->supply(1, 2), this->supply(3, 4), + this->supply(5, 6)}; + auto chain = cti::when_any(std::make_tuple(std::move(v))); + EXPECT_ASYNC_RESULT(std::move(chain), 1, 2); + } + { // Check the evaluation order unsigned i = 0;