Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/sender-demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static_assert(ex::sender_in<just_sender<std::pmr::string>>);

int main() {
try {
auto j = just_sender{std::pmr::string("value")};
auto j = just_sender<std::pmr::string>{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),
Expand Down
2 changes: 2 additions & 0 deletions include/beman/execution/detail/counting_scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <beman/execution/detail/counting_scope_base.hpp>
#include <beman/execution/detail/counting_scope_join.hpp>
#include <beman/execution/detail/scope_token.hpp>
#include <beman/execution/detail/sender.hpp>
#include <beman/execution/detail/inplace_stop_source.hpp>
#include <beman/execution/detail/stop_when.hpp>
Expand Down Expand Up @@ -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>);

// ----------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions include/beman/execution/detail/spawn_future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>(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 {
Expand Down
9 changes: 4 additions & 5 deletions include/beman/execution/detail/stop_when.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -102,12 +101,12 @@ struct beman::execution::detail::stop_when_t::sender {
state(S&& s, T&& t, R&& r)
: tok(::std::forward<T>(t)),
base{::std::forward<R>(r)},
inner_state(::beman::execution::connect(::std::forward<S>(s), receiver(&this->base))) {}
inner_state(::beman::execution::connect(::std::forward<S>(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);
}
};
Expand All @@ -127,7 +126,7 @@ inline auto beman::execution::detail::stop_when_t::operator()(Sndr&& sndr, Tok&&
if constexpr (::beman::execution::unstoppable_token<Tok>) {
return ::std::forward<Sndr>(sndr);
} else {
return sender<Sndr, Tok>(*this, ::std::forward<Tok>(tok), ::std::forward<Sndr>(sndr));
return sender<Sndr, Tok>{*this, ::std::forward<Tok>(tok), ::std::forward<Sndr>(sndr)};
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/beman/execution/exec-opstate-start.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct non_opstate {
template <bool Noexcept>
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 <typename State>
Expand Down
4 changes: 2 additions & 2 deletions tests/beman/execution/exec-scope-counting.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/beman/execution/exec-spawn-future.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<decltype(alloc), allocator>);
ASSERT(alloc == allocator{101});
Expand Down