Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
apply_all.hpp
Go to the documentation of this file.
1// Copyright 2024, Toyota Motor Corporation
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_LIST_APPLY_ALL_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_LIST_APPLY_ALL_HPP_
7
8// IWYU pragma: private, include "arene/base/type_list.hpp"
9// IWYU pragma: friend "(arene/base(?!/tests)|stdlib/include/stdlib_detail)/.*"
10
11namespace arene {
12namespace base {
13
14namespace type_lists {
15
16/// @cond INTERNAL
17
18namespace apply_all_detail {
19
20/// @brief Evaluate a template meta-function, passing the elements of
21/// the type-list L0 as the arguments.
22/// @tparam L0 An instantiation of a type-list that holds the types
23/// @pre @c L0 is a type-list
24template <class L0, template <class...> class Apply>
25struct apply_all_impl;
26
27/// @brief Evaluate a template meta-function, passing the elements of
28/// the type-list as the arguments.
29/// @tparam TypeList0 A type list template
30/// @tparam In The types in the type list
31/// @tparam Apply The metafunction to apply to each element
32template <template <class...> class TypeList0, class... In, template <class...> class Apply>
33struct apply_all_impl<TypeList0<In...>, Apply> {
34 /// @brief @p type is a type that is the result of invoking
35 /// @p Apply<> once with all of the elements of the type list
36 using type = Apply<In...>;
37};
38
39} // namespace apply_all_detail
40
41/// @endcond
42
43/// @brief Evaluate a template meta-function, passing the elements of
44/// the type-list L0 as the arguments.
45/// @tparam L0 An instantiation of a type-list that holds the types
46/// @pre @c L0 is a type-list
47template <class L0, template <class...> class Func>
48using apply_all = arene::base::type_lists::apply_all_detail::apply_all_impl<L0, Func>;
49
50/// @brief Evaluate a template meta-function, passing the elements of
51/// the type-list L0 as the arguments.
52/// @tparam L0 An instantiation of a type-list that holds the types
53/// @pre @c L0 is a type-list
54template <class L0, template <class...> class Func>
55using apply_all_t = typename apply_all<L0, Func>::type;
56
57} // namespace type_lists
58} // namespace base
59} // namespace arene
60
61#endif // INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_LIST_APPLY_ALL_HPP_
Definition apply_all.hpp:14
Definition array_exceptions_disabled.cpp:11
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10