1
+ // src/beman/execution26/tests/meta-transform.pass.cpp -*-C++-*-
2
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3
+
4
+ #include < beman/execution26/detail/meta_transform.hpp>
5
+ #include < beman/execution26/detail/type_list.hpp>
6
+ #include < test/execution.hpp>
7
+ #include < concepts>
8
+ #include < type_traits>
9
+
10
+ // ----------------------------------------------------------------------------
11
+
12
+ namespace
13
+ {
14
+ template <typename >
15
+ struct foo {};
16
+ template <typename T>
17
+ using bar = foo<T>;
18
+
19
+ template <typename T>
20
+ struct baz { using type = foo<T>; };
21
+ template <typename T>
22
+ using baz_t = typename baz<T>::type;;
23
+ }
24
+
25
+ auto main () -> int
26
+ {
27
+ static_assert (std::same_as<
28
+ test_detail::type_list<>,
29
+ test_detail::meta::transform<foo, test_detail::type_list<>>
30
+ >);
31
+ static_assert (std::same_as<
32
+ test_detail::type_list<foo<bool >, foo<char >>,
33
+ test_detail::meta::transform<foo, test_detail::type_list<bool , char >>
34
+ >);
35
+ static_assert (std::same_as<
36
+ test_detail::type_list<foo<bool >, foo<char >>,
37
+ test_detail::meta::transform<bar, test_detail::type_list<bool , char >>
38
+ >);
39
+ static_assert (std::same_as<
40
+ test_detail::type_list<foo<bool >, foo<char >>,
41
+ test_detail::meta::transform<baz_t , test_detail::type_list<bool , char >>
42
+ >);
43
+ static_assert (std::same_as<
44
+ test_detail::type_list<bool , char >,
45
+ test_detail::meta::transform<std::type_identity_t , test_detail::type_list<bool , char >>
46
+ >);
47
+ }
0 commit comments