-
Notifications
You must be signed in to change notification settings - Fork 17
Work around clang issue #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e3f1ee7
4e5e6ac
5cb179e
f28950b
ca4a70e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,6 +28,8 @@ | |||||||||||||
| #include <concepts> | ||||||||||||||
| #include <type_traits> | ||||||||||||||
|
|
||||||||||||||
| #include <beman/execution/detail/suppress_push.hpp> | ||||||||||||||
|
|
||||||||||||||
| // ---------------------------------------------------------------------------- | ||||||||||||||
|
|
||||||||||||||
| namespace beman::execution::detail { | ||||||||||||||
|
|
@@ -63,6 +65,21 @@ struct affine_on_t : ::beman::execution::sender_adaptor_closure<affine_on_t> { | |||||||||||||
| */ | ||||||||||||||
| auto operator()() const { return ::beman::execution::detail::sender_adaptor{*this}; } | ||||||||||||||
|
|
||||||||||||||
| template <typename Ev> | ||||||||||||||
| struct ao_env { | ||||||||||||||
| Ev ev_; | ||||||||||||||
| auto query(const ::beman::execution::get_stop_token_t&) const noexcept | ||||||||||||||
| -> ::beman::execution::never_stop_token { | ||||||||||||||
| return ::beman::execution::never_stop_token(); | ||||||||||||||
| } | ||||||||||||||
| template <typename Q> | ||||||||||||||
| auto query(const Q& q) const noexcept -> decltype(q(this->ev_)) { | ||||||||||||||
| return q(this->ev_); | ||||||||||||||
| } | ||||||||||||||
| }; | ||||||||||||||
| template <typename Ev> | ||||||||||||||
| ao_env(const Ev&) -> ao_env<Ev>; | ||||||||||||||
|
|
||||||||||||||
| /** | ||||||||||||||
| * @brief affine_on is implemented by transforming it into a use of schedule_from. | ||||||||||||||
| * | ||||||||||||||
|
|
@@ -89,35 +106,33 @@ struct affine_on_t : ::beman::execution::sender_adaptor_closure<affine_on_t> { | |||||||||||||
| ::beman::execution::get_completion_signatures( | ||||||||||||||
| ::beman::execution::schedule(::beman::execution::get_scheduler(env)), | ||||||||||||||
| ::beman::execution::detail::join_env( | ||||||||||||||
| ::beman::execution::env{::beman::execution::prop{::beman::execution::get_stop_token, | ||||||||||||||
| ::beman::execution::never_stop_token{}}}, | ||||||||||||||
| ::beman::execution::env{::beman::execution::prop{ | ||||||||||||||
| ::beman::execution::get_stop_token, ::beman::execution::never_stop_token{}, {}}}, | ||||||||||||||
| env)) | ||||||||||||||
| } -> ::std::same_as<::beman::execution::completion_signatures<::beman::execution::set_value_t()>>; | ||||||||||||||
| } | ||||||||||||||
| static auto transform_sender(Sender&& sender, const Env& env) { | ||||||||||||||
| static auto transform_sender(Sender&& sender, const Env& ev) { | ||||||||||||||
| [[maybe_unused]] auto& [tag, data, child] = sender; | ||||||||||||||
| using child_tag_t = ::beman::execution::tag_of_t<::std::remove_cvref_t<decltype(child)>>; | ||||||||||||||
|
|
||||||||||||||
| #if 0 | ||||||||||||||
| if constexpr (requires(const child_tag_t& t) { | ||||||||||||||
| { | ||||||||||||||
| t.affine_on(::beman::execution::detail::forward_like<Sender>(child), env) | ||||||||||||||
| t.affine_on(::beman::execution::detail::forward_like<Sender>(child), ev) | ||||||||||||||
| } -> ::beman::execution::sender; | ||||||||||||||
| }) | ||||||||||||||
| #else | ||||||||||||||
| if constexpr (::beman::execution::detail::nested_sender_has_affine_on<Sender, Env>) | ||||||||||||||
| #endif | ||||||||||||||
| { | ||||||||||||||
|
||||||||||||||
| { | |
| { | |
| // NOTE: Some compilers (e.g. certain Clang versions) have had issues | |
| // when invoking affine_on on a temporary, i.e. child_tag_t{}.affine_on(...). | |
| // Using a named constexpr instance here avoids those issues; do not | |
| // simplify back to a temporary without re-validating compiler support. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ template <typename Query, typename Value> | |
| struct prop; | ||
|
|
||
| template <typename Query, typename Value> | ||
| prop(Query, Value) -> prop<Query, ::std::unwrap_reference_t<Value>>; | ||
| prop(Query, Value, ::beman::execution::detail::non_assignable = {}) -> prop<Query, ::std::unwrap_reference_t<Value>>; | ||
|
||
| } // namespace beman::execution | ||
|
|
||
| template <typename V> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The third parameter
{}is passed explicitly to thepropconstructor even though the deduction guide provides a default value for thenon_assignableparameter. If the default value works correctly, this explicit{}may be unnecessary. Consider removing it to simplify the code and rely on the default parameter, or add a comment explaining why the explicit parameter is required.