Skip to content

Commit

Permalink
another attempt at fixing a gcc compilation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dietmarkuehl committed Dec 21, 2024
1 parent ab3a204 commit a38953d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
9 changes: 5 additions & 4 deletions include/beman/execution26/detail/basic_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct basic_sender : ::beman::execution26::detail::product_type<Tag, Data, Chil
auto connect(Receiver receiver) = BEMAN_EXECUTION26_DELETE("the passed receiver doesn't model receiver");

private:
#if __cpp_explicit_this_parameter < 202110L
#if __cpp_explicit_this_parameter < 302110L //-dk:TODO need to figure out how to use explicit this with forwarding
template <::beman::execution26::receiver Receiver>
auto connect(Receiver receiver) & noexcept(
noexcept(::beman::execution26::detail::basic_operation<basic_sender&, Receiver>{*this, ::std::move(receiver)}))
Expand All @@ -66,9 +66,10 @@ struct basic_sender : ::beman::execution26::detail::product_type<Tag, Data, Chil
}
#else
template <::beman::execution26::detail::decays_to<basic_sender> Self, ::beman::execution26::receiver Receiver>
auto connect(this Self&& self, Receiver receiver) noexcept(
noexcept(::beman::execution26::detail::basic_operation<basic_sender, Receiver>{::std::forward<Self>(self),
::std::move(receiver)}))
auto
connect(this Self&& self,
Receiver receiver) noexcept(noexcept(::beman::execution26::detail::basic_operation<basic_sender, Receiver>{
::std::forward<Self>(self), ::std::move(receiver)}))
-> ::beman::execution26::detail::basic_operation<Self, Receiver> {
return {::std::forward<Self>(self), ::std::move(receiver)};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ struct get_completion_signatures_t {
static auto get(Sender&& sender, Env&& env) noexcept {
auto new_sender{[](auto&& sndr, auto&& e) -> decltype(auto) {
auto domain{::beman::execution26::detail::get_domain_late(sndr, e)};
return ::beman::execution26::transform_sender(domain,
::std::forward<Sender>(sndr),
::std::forward<Env>(e));
return ::beman::execution26::transform_sender(
domain, ::std::forward<Sender>(sndr), ::std::forward<Env>(e));
}};

using sender_type = ::std::remove_cvref_t<decltype(new_sender(sender, env))>;
Expand Down
3 changes: 1 addition & 2 deletions include/beman/execution26/detail/simple_counting_scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ class beman::execution26::simple_counting_scope::assoc {

private:
friend class beman::execution26::simple_counting_scope::token;
explicit assoc(beman::execution26::simple_counting_scope* scp)
: scope(scp ? scp->try_associate() : nullptr) {}
explicit assoc(beman::execution26::simple_counting_scope* scp) : scope(scp ? scp->try_associate() : nullptr) {}
beman::execution26::simple_counting_scope* scope{};
};
// NOLINTEND(misc-unconventional-assign-operator,hicpp-special-member-functions)
Expand Down
7 changes: 3 additions & 4 deletions tests/beman/execution26/exec-connect.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ struct receiver {
int value{};
bool* set_stopped_called{};

explicit receiver(int val, bool* called = {})
: value(val), set_stopped_called(called) {}
explicit receiver(int val, bool* called = {}) : value(val), set_stopped_called(called) {}
receiver(receiver&&) = default;
receiver(const receiver&) = delete;
~receiver() = default;
Expand Down Expand Up @@ -295,7 +294,7 @@ auto test_connect_awaitable() -> void {
}

auto test_connect_with_awaiter() -> void {
struct awaiter {
struct local_awaiter {
::std::coroutine_handle<>& handle;
auto await_ready() -> bool { return {}; }
auto await_suspend(std::coroutine_handle<> h) -> void { this->handle = h; }
Expand All @@ -311,7 +310,7 @@ auto test_connect_with_awaiter() -> void {

std::coroutine_handle<> handle{};
bool result{};
auto op{test_std::connect(awaiter{handle}, local_receiver{result})};
auto op{test_std::connect(local_awaiter{handle}, local_receiver{result})};
ASSERT(handle == std::coroutine_handle{});
test_std::start(op);
ASSERT(handle != std::coroutine_handle{});
Expand Down

0 comments on commit a38953d

Please sign in to comment.