diff --git a/examples/sender-demo.cpp b/examples/sender-demo.cpp index e998d294..d9ac194e 100644 --- a/examples/sender-demo.cpp +++ b/examples/sender-demo.cpp @@ -47,7 +47,7 @@ static_assert(ex::sender_in>); int main() { try { - auto j = just_sender{std::pmr::string("value")}; + auto j = just_sender{std::pmr::string("value")}; auto t = std::move(j) | ex::then([](const std::pmr::string& v) { return v + " then"; }); auto w = ex::when_all(std::move(t)); auto e = ex::detail::write_env(std::move(w), diff --git a/include/beman/execution/detail/counting_scope.hpp b/include/beman/execution/detail/counting_scope.hpp index 46370e7f..30def4a7 100644 --- a/include/beman/execution/detail/counting_scope.hpp +++ b/include/beman/execution/detail/counting_scope.hpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -50,6 +51,7 @@ class beman::execution::counting_scope::token : public ::beman::execution::detai explicit token(::beman::execution::counting_scope* s) : ::beman::execution::detail::counting_scope_base::token(s) {} }; +static_assert(::beman::execution::scope_token<::beman::execution::counting_scope::token>); // ---------------------------------------------------------------------------- diff --git a/include/beman/execution/detail/spawn_future.hpp b/include/beman/execution/detail/spawn_future.hpp index e282aa57..bafbce0e 100644 --- a/include/beman/execution/detail/spawn_future.hpp +++ b/include/beman/execution/detail/spawn_future.hpp @@ -128,13 +128,13 @@ struct spawn_future_state : alloc(::std::move(a)), op(::beman::execution::write_env( ::beman::execution::detail::stop_when(::std::forward(s), source.get_token()), env), - receiver_t(this)), + receiver_t{this}), token(::std::move(tok)), associated(token.try_associate()) { if (this->associated) { ::beman::execution::start(this->op); } else { - ::beman::execution::set_stopped(receiver_t(this)); + ::beman::execution::set_stopped(receiver_t{this}); } } auto complete() noexcept -> void override { diff --git a/include/beman/execution/detail/stop_when.hpp b/include/beman/execution/detail/stop_when.hpp index 371b7ec5..f989ec32 100644 --- a/include/beman/execution/detail/stop_when.hpp +++ b/include/beman/execution/detail/stop_when.hpp @@ -27,7 +27,6 @@ namespace beman::execution::detail { inline constexpr struct stop_when_t { - template <::beman::execution::sender Sndr, ::beman::execution::stoppable_token Tok> struct sender; @@ -102,12 +101,12 @@ struct beman::execution::detail::stop_when_t::sender { state(S&& s, T&& t, R&& r) : tok(::std::forward(t)), base{::std::forward(r)}, - inner_state(::beman::execution::connect(::std::forward(s), receiver(&this->base))) {} + inner_state(::beman::execution::connect(::std::forward(s), receiver{&this->base})) {} auto start() & noexcept { - this->cb1.emplace(this->tok, cb_t(this->base.source)); + this->cb1.emplace(this->tok, cb_t{this->base.source}); this->cb2.emplace(::beman::execution::get_stop_token(::beman::execution::get_env(this->base.rcvr)), - cb_t(this->base.source)); + cb_t{this->base.source}); ::beman::execution::start(this->inner_state); } }; @@ -127,7 +126,7 @@ inline auto beman::execution::detail::stop_when_t::operator()(Sndr&& sndr, Tok&& if constexpr (::beman::execution::unstoppable_token) { return ::std::forward(sndr); } else { - return sender(*this, ::std::forward(tok), ::std::forward(sndr)); + return sender{*this, ::std::forward(tok), ::std::forward(sndr)}; } } diff --git a/tests/beman/execution/exec-opstate-start.test.cpp b/tests/beman/execution/exec-opstate-start.test.cpp index 45cd1bdc..c1ff95b7 100644 --- a/tests/beman/execution/exec-opstate-start.test.cpp +++ b/tests/beman/execution/exec-opstate-start.test.cpp @@ -21,7 +21,7 @@ struct non_opstate { template struct opstate { receiver rcvr; - auto start() const noexcept(Noexcept) -> void { test_std::set_value(receiver(this->rcvr.value), 42); } + auto start() const noexcept(Noexcept) -> void { test_std::set_value(receiver{this->rcvr.value}, 42); } }; template diff --git a/tests/beman/execution/exec-scope-counting.test.cpp b/tests/beman/execution/exec-scope-counting.test.cpp index 6e685134..32e183c5 100644 --- a/tests/beman/execution/exec-scope-counting.test.cpp +++ b/tests/beman/execution/exec-scope-counting.test.cpp @@ -109,7 +109,7 @@ auto mem() -> void { ASSERT(true == scope.get_token().try_associate()); bool called{false}; ASSERT(called == false); - auto state(test_std::connect(scope.join(), join_receiver(called))); + auto state(test_std::connect(scope.join(), join_receiver{called})); ASSERT(called == false); test_std::start(state); ASSERT(called == false); @@ -125,7 +125,7 @@ auto token() -> void { ASSERT(true == tok.try_associate()); bool called{false}; - auto state(test_std::connect(scope.join(), join_receiver(called))); + auto state(test_std::connect(scope.join(), join_receiver{called})); test_std::start(state); ASSERT(false == called); scope.close(); diff --git a/tests/beman/execution/exec-spawn-future.test.cpp b/tests/beman/execution/exec-spawn-future.test.cpp index de6a80a4..17077fc3 100644 --- a/tests/beman/execution/exec-spawn-future.test.cpp +++ b/tests/beman/execution/exec-spawn-future.test.cpp @@ -274,7 +274,7 @@ auto test_get_allocator() { test_std::inplace_stop_source source; auto [alloc, ev] = test_detail::spawn_get_allocator( alloc_sender{53}, - test_detail::join_env(test_std::prop(test_std::get_allocator, allocator(101)), + test_detail::join_env(test_std::prop(test_std::get_allocator, allocator{101}), test_std::prop(test_std::get_stop_token, source.get_token()))); static_assert(std::same_as); ASSERT(alloc == allocator{101});