kokkos-execution 0.0.1
Loading...
Searching...
No Matches
test_env.cpp
Go to the documentation of this file.
1#include <concepts>
2
3#include "gtest/gtest.h"
4
6
17
18namespace Tests::Impl {
19
20constexpr struct PropA : public stdexec::__query<PropA> {
22
23constexpr struct FwdPropC
24 : public stdexec::__query<FwdPropC>
25 , stdexec::forwarding_query_t {
26 using stdexec::__query<FwdPropC>::operator();
28
30TEST(forwarding, queryable) {
31 static_assert([]() {
32 auto env = stdexec::env{
33 stdexec::prop{ prop_a, 123},
34 stdexec::prop{fwd_prop_c, 123}
35 };
36
37 static_assert(stdexec::__queryable_with<decltype(env), PropA>);
38 static_assert(stdexec::__queryable_with<decltype(env), FwdPropC>);
39
40 auto fwd_env = stdexec::__fwd_env(stdexec::__fwd_env(env));
41
42 static_assert(
43 std::same_as<
44 decltype(fwd_env),
45 stdexec::__env::__fwd<
46 stdexec::env<stdexec::prop<Tests::Impl::PropA, int>, stdexec::prop<Tests::Impl::FwdPropC, int>>&
47 >
48 >);
49
50 static_assert(!stdexec::__queryable_with<decltype(fwd_env), PropA>);
51 static_assert(stdexec::__queryable_with<decltype(fwd_env), FwdPropC>);
52
53 return true;
54 }());
55}
56
57} // namespace Tests::Impl
Tests::Impl::FwdPropC fwd_prop_c
Tests::Impl::PropA prop_a
Tests::PropA prop_a