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