diff --git a/include/beman/execution26/detail/completion_signatures_of_t.hpp b/include/beman/execution26/detail/completion_signatures_of_t.hpp index 7020c2ff..e66dbe7f 100644 --- a/include/beman/execution26/detail/completion_signatures_of_t.hpp +++ b/include/beman/execution26/detail/completion_signatures_of_t.hpp @@ -13,9 +13,13 @@ namespace beman::execution26 { - template - requires beman::execution26::sender_in - using completion_signatures_of_t = int; + template + requires ::beman::execution26::sender_in + using completion_signatures_of_t + = ::beman::execution26::detail::call_result_t< + ::beman::execution26::get_completion_signatures_t, Sender, Env + > + ; } // ---------------------------------------------------------------------------- diff --git a/src/beman/execution26/tests/execution-syn.pass.cpp b/src/beman/execution26/tests/execution-syn.pass.cpp index acd0ee35..4f2d1d32 100644 --- a/src/beman/execution26/tests/execution-syn.pass.cpp +++ b/src/beman/execution26/tests/execution-syn.pass.cpp @@ -85,13 +85,19 @@ namespace struct sender_in { + struct arg {}; + using sender_concept = test_std::sender_t; - using completion_signatures = test_std::completion_signatures<>; + using completion_signatures = test_std::completion_signatures< + test_std::set_value_t(arg), + test_std::set_stopped_t() + >; }; template auto test_completion_signatures_of_t() -> void { + struct env {}; struct non_sender {}; static_assert(not requires{ typename T; @@ -100,7 +106,50 @@ namespace static_assert(test_std::sender); static_assert(test_std::sender_in); - //-dk:TODO add actually meaningful test + static_assert(requires{ + typename test_std::completion_signatures_of_t; + { test_std::completion_signatures_of_t{} } + -> std::same_as; + }); + + struct sender_with_get + { + struct arg {}; + + using sender_concept = test_std::sender_t; + + using empty_sigs = test_std::completion_signatures< + test_std::set_value_t(arg), + test_std::set_stopped_t() + >; + auto get_completion_signatures(test_std::empty_env) const noexcept + { + return empty_sigs{}; + } + + using env_sigs = test_std::completion_signatures< + test_std::set_value_t(arg, arg), + test_std::set_stopped_t() + >; + auto get_completion_signatures(env) const noexcept + { + return env_sigs{}; + } + }; + static_assert(not std::same_as); + static_assert(test_std::sender); + static_assert(test_std::sender_in); + static_assert(requires{ + typename test_std::completion_signatures_of_t; + { test_std::completion_signatures_of_t{} } + -> std::same_as; + }); + static_assert(requires{ + typename test_std::completion_signatures_of_t; + { test_std::completion_signatures_of_t{} } + -> std::same_as; + }); } }