kokkos-execution 0.0.1
Loading...
Searching...
No Matches
check_rcvr_env.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_TESTS_UTILS_CHECK_RCVR_ENV_HPP
2#define KOKKOS_EXECUTION_TESTS_UTILS_CHECK_RCVR_ENV_HPP
3
5
8
9namespace Tests::Utils {
10
11template <typename ExpectedEnv, typename Sndr>
13 using sender_concept = stdexec::sender_tag;
14
15 Sndr sndr;
16
18
19 template <stdexec::receiver Rcvr>
20 constexpr auto connect(Rcvr rcvr) && noexcept(stdexec::__nothrow_connectable<Sndr&&, Rcvr&&>) {
21 static_assert(std::same_as<ExpectedEnv, stdexec::env_of_t<Rcvr>>);
22 return stdexec::connect(std::forward<Sndr>(sndr), std::move(rcvr));
23 }
24
25 template <stdexec::receiver Rcvr>
26 constexpr auto connect(Rcvr rcvr) const & noexcept(stdexec::__nothrow_connectable<Sndr const &, Rcvr&&>) {
27 static_assert(std::same_as<ExpectedEnv, stdexec::env_of_t<Rcvr>>);
28 return stdexec::connect(sndr, std::move(rcvr));
29 }
30
32};
33
35template <typename ExpectedEnv>
37 [[nodiscard]]
38 constexpr auto operator()() const noexcept {
39 return stdexec::__closure(*this);
40 }
41
42 template <stdexec::sender Sndr>
43 [[nodiscard]]
44 constexpr auto operator()(Sndr&& sndr) const {
45 return CheckRcvrEnvSender<ExpectedEnv, Sndr>{std::forward<Sndr>(sndr)};
46 }
47};
48
49template <typename ExpectedEnv>
51
52} // namespace Tests::Utils
53
54#endif // KOKKOS_EXECUTION_TESTS_UTILS_CHECK_RCVR_ENV_HPP
#define KOKKOS_EXECUTION_IMPL_FORWARDING_ATTRIBUTES_GET_ENV(_type_, _obj_)
#define KOKKOS_EXECUTION_COMPL_SIGS_KEEP(_sndr_type_)
constexpr check_rcvr_env_t< ExpectedEnv > check_rcvr_env
constexpr auto connect(Rcvr rcvr) &&noexcept(stdexec::__nothrow_connectable< Sndr &&, Rcvr && >)
constexpr auto connect(Rcvr rcvr) const &noexcept(stdexec::__nothrow_connectable< Sndr const &, Rcvr && >)
Check that the receiver environment is of type ExpectedEnv.
constexpr auto operator()(Sndr &&sndr) const
constexpr auto operator()() const noexcept