Skip to content
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

set_next doesn't detect tag_invoke overloads #631

Open
glebov-andrey opened this issue Aug 28, 2024 · 0 comments
Open

set_next doesn't detect tag_invoke overloads #631

glebov-andrey opened this issue Aug 28, 2024 · 0 comments

Comments

@glebov-andrey
Copy link

Hi,

There is an issue with set_next not finding tag_invoke(Receiver &, ...) overloads, while member functions work fine.

Here is a patch which fixes the issue:

diff --git a/include/unifex/receiver_concepts.hpp b/include/unifex/receiver_concepts.hpp
index 8a4af7b..2a415e9 100644
--- a/include/unifex/receiver_concepts.hpp
+++ b/include/unifex/receiver_concepts.hpp
@@ -65,20 +65,20 @@ inline const struct _set_next_fn {
 private:
   template <typename Receiver, typename... Values>
   using set_next_member_result_t =
-      decltype(UNIFEX_DECLVAL(Receiver&).set_next(UNIFEX_DECLVAL(Values)...));
+      decltype(UNIFEX_DECLVAL(Receiver).set_next(UNIFEX_DECLVAL(Values)...));
   template <typename Receiver, typename... Values>
   using _result_t = typename conditional_t<
       tag_invocable<_set_next_fn, Receiver&, Values...>,
       meta_tag_invoke_result<_set_next_fn>,
       meta_quote1_<set_next_member_result_t>>::
-      template apply<Receiver, Values...>;
+      template apply<Receiver&, Values...>;
 
 public:
   template(typename Receiver, typename... Values)                  //
-      (requires tag_invocable<_set_next_fn, Receiver, Values...>)  //
+      (requires tag_invocable<_set_next_fn, Receiver&, Values...>)  //
       auto
       operator()(Receiver& r, Values&&... values) const
-      noexcept(is_nothrow_tag_invocable_v<_set_next_fn, Receiver, Values...>)
+      noexcept(is_nothrow_tag_invocable_v<_set_next_fn, Receiver&, Values...>)
           -> _result_t<Receiver, Values...> {
     return unifex::tag_invoke(_set_next_fn{}, r, (Values &&) values...);
   }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant