kokkos-execution
0.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
test_env.cpp
Go to the documentation of this file.
1
#include "gtest/gtest.h"
2
3
#include "
kokkos-execution/stdexec.hpp
"
4
15
16
namespace
Tests::Impl
{
17
18
constexpr
struct
PropA
:
public
stdexec::__query<PropA> {
19
}
prop_a
{};
20
21
constexpr
struct
FwdPropC
22
:
public
stdexec::__query<FwdPropC>
23
, stdexec::forwarding_query_t {
24
using
stdexec::__query<
FwdPropC
>::operator();
25
}
fwd_prop_c
{};
26
28
TEST(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
const
auto
fwd_env = stdexec::__fwd_env(stdexec::__fwd_env(env));
39
40
static_assert
(
41
std::same_as<
42
std::remove_const_t<
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
stdexec.hpp
Tests::Impl
Definition
test_completion_signal.cpp:23
Tests::Impl::fwd_prop_c
Tests::Impl::FwdPropC fwd_prop_c
Tests::Impl::prop_a
Tests::Impl::PropA prop_a
Tests::prop_a
Tests::PropA prop_a
Tests::Impl::FwdPropC
Definition
test_env.cpp:23
Tests::Impl::PropA
Definition
test_env.cpp:18
tests
impl
test_env.cpp
Generated on
for kokkos-execution by
1.18.0