Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:22:02

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2021-2022 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 #pragma once
0009 
0010 namespace traccc::details::functor {
0011 /**
0012  * @brief The identity functor, such that `identity<T>` is equivalent to `T`.
0013  */
0014 template <typename T>
0015 using identity = T;
0016 
0017 /**
0018  * @brief The reference functor, such that `reference<T>` is equivalent to `T&`.
0019  */
0020 template <typename T>
0021 using reference = T&;
0022 
0023 /**
0024  * @brief The const reference functor, such that `const_reference<T>` is
0025  * equivalent to `const T&`.
0026  */
0027 template <typename T>
0028 using const_reference = const T&;
0029 
0030 /**
0031  * @brief A natural transformation between two functors.
0032  *
0033  * Given two functors F1 and F2 as well as some types Ts... such that
0034  * `F2<Ts...>` is a type, this produces `F1<Ts...>`.
0035  */
0036 template <template <typename...> typename F, typename T>
0037 struct reapply {};
0038 
0039 template <template <typename...> typename F1,
0040           template <typename...> typename F2, typename... Ts>
0041 struct reapply<F1, F2<Ts...>> {
0042   using type = F1<Ts...>;
0043 };
0044 }  // namespace traccc::details::functor