Skip to content

Commit 330be95

Browse files
authored
Fix issues with xcode 15.4 (#177)
1 parent 94ec64a commit 330be95

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

examples/sender-demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static_assert(ex::sender_in<just_sender<std::pmr::string>>);
4747

4848
int main() {
4949
try {
50-
auto j = just_sender{std::pmr::string("value")};
50+
auto j = just_sender<std::pmr::string>{std::pmr::string("value")};
5151
auto t = std::move(j) | ex::then([](const std::pmr::string& v) { return v + " then"; });
5252
auto w = ex::when_all(std::move(t));
5353
auto e = ex::detail::write_env(std::move(w),

include/beman/execution/detail/counting_scope.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <beman/execution/detail/counting_scope_base.hpp>
88
#include <beman/execution/detail/counting_scope_join.hpp>
9+
#include <beman/execution/detail/scope_token.hpp>
910
#include <beman/execution/detail/sender.hpp>
1011
#include <beman/execution/detail/inplace_stop_source.hpp>
1112
#include <beman/execution/detail/stop_when.hpp>
@@ -50,6 +51,7 @@ class beman::execution::counting_scope::token : public ::beman::execution::detai
5051
explicit token(::beman::execution::counting_scope* s)
5152
: ::beman::execution::detail::counting_scope_base::token(s) {}
5253
};
54+
static_assert(::beman::execution::scope_token<::beman::execution::counting_scope::token>);
5355

5456
// ----------------------------------------------------------------------------
5557

include/beman/execution/detail/spawn_future.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ struct spawn_future_state
128128
: alloc(::std::move(a)),
129129
op(::beman::execution::write_env(
130130
::beman::execution::detail::stop_when(::std::forward<S>(s), source.get_token()), env),
131-
receiver_t(this)),
131+
receiver_t{this}),
132132
token(::std::move(tok)),
133133
associated(token.try_associate()) {
134134
if (this->associated) {
135135
::beman::execution::start(this->op);
136136
} else {
137-
::beman::execution::set_stopped(receiver_t(this));
137+
::beman::execution::set_stopped(receiver_t{this});
138138
}
139139
}
140140
auto complete() noexcept -> void override {

include/beman/execution/detail/stop_when.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
namespace beman::execution::detail {
2929
inline constexpr struct stop_when_t {
30-
3130
template <::beman::execution::sender Sndr, ::beman::execution::stoppable_token Tok>
3231
struct sender;
3332

@@ -102,12 +101,12 @@ struct beman::execution::detail::stop_when_t::sender {
102101
state(S&& s, T&& t, R&& r)
103102
: tok(::std::forward<T>(t)),
104103
base{::std::forward<R>(r)},
105-
inner_state(::beman::execution::connect(::std::forward<S>(s), receiver(&this->base))) {}
104+
inner_state(::beman::execution::connect(::std::forward<S>(s), receiver{&this->base})) {}
106105

107106
auto start() & noexcept {
108-
this->cb1.emplace(this->tok, cb_t(this->base.source));
107+
this->cb1.emplace(this->tok, cb_t{this->base.source});
109108
this->cb2.emplace(::beman::execution::get_stop_token(::beman::execution::get_env(this->base.rcvr)),
110-
cb_t(this->base.source));
109+
cb_t{this->base.source});
111110
::beman::execution::start(this->inner_state);
112111
}
113112
};
@@ -127,7 +126,7 @@ inline auto beman::execution::detail::stop_when_t::operator()(Sndr&& sndr, Tok&&
127126
if constexpr (::beman::execution::unstoppable_token<Tok>) {
128127
return ::std::forward<Sndr>(sndr);
129128
} else {
130-
return sender<Sndr, Tok>(*this, ::std::forward<Tok>(tok), ::std::forward<Sndr>(sndr));
129+
return sender<Sndr, Tok>{*this, ::std::forward<Tok>(tok), ::std::forward<Sndr>(sndr)};
131130
}
132131
}
133132

tests/beman/execution/exec-opstate-start.test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct non_opstate {
2121
template <bool Noexcept>
2222
struct opstate {
2323
receiver rcvr;
24-
auto start() const noexcept(Noexcept) -> void { test_std::set_value(receiver(this->rcvr.value), 42); }
24+
auto start() const noexcept(Noexcept) -> void { test_std::set_value(receiver{this->rcvr.value}, 42); }
2525
};
2626

2727
template <typename State>

tests/beman/execution/exec-scope-counting.test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ auto mem() -> void {
109109
ASSERT(true == scope.get_token().try_associate());
110110
bool called{false};
111111
ASSERT(called == false);
112-
auto state(test_std::connect(scope.join(), join_receiver(called)));
112+
auto state(test_std::connect(scope.join(), join_receiver{called}));
113113
ASSERT(called == false);
114114
test_std::start(state);
115115
ASSERT(called == false);
@@ -125,7 +125,7 @@ auto token() -> void {
125125

126126
ASSERT(true == tok.try_associate());
127127
bool called{false};
128-
auto state(test_std::connect(scope.join(), join_receiver(called)));
128+
auto state(test_std::connect(scope.join(), join_receiver{called}));
129129
test_std::start(state);
130130
ASSERT(false == called);
131131
scope.close();

tests/beman/execution/exec-spawn-future.test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ auto test_get_allocator() {
274274
test_std::inplace_stop_source source;
275275
auto [alloc, ev] = test_detail::spawn_get_allocator(
276276
alloc_sender{53},
277-
test_detail::join_env(test_std::prop(test_std::get_allocator, allocator(101)),
277+
test_detail::join_env(test_std::prop(test_std::get_allocator, allocator{101}),
278278
test_std::prop(test_std::get_stop_token, source.get_token())));
279279
static_assert(std::same_as<decltype(alloc), allocator>);
280280
ASSERT(alloc == allocator{101});

0 commit comments

Comments
 (0)