Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Acts/Utilities/detail/MPL/at_index.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2016-2018 CERN for the benefit of the Acts project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 namespace Acts::detail {
0011 /**
0012  * @brief return integral constant at position in template parameter pack
0013  *
0014  * @tparam T integral type of the values to be investigated
0015  * @tparam index position in the template parameter pack
0016  * @tparam values template parameter pack containing the list of values
0017  *
0018  * @return `at_index<T,index,values...>::type` yields the integral constant
0019  *         at the given position in `values` if 0 &le; `index` <
0020  *         sizeof...(values). Otherwise, a compile-time error is generated.
0021  */
0022 template <typename T, std::size_t index, T... values>
0023 struct at_index;
0024 
0025 /// @cond
0026 template <typename T, std::size_t index, T next, T... others>
0027 struct at_index<T, index, next, others...> {
0028   static constexpr T value = at_index<T, index - 1, others...>::value;
0029 };
0030 
0031 template <typename T, T next, T... others>
0032 struct at_index<T, 0, next, others...> {
0033   static constexpr T value = next;
0034 };
0035 /// @endcond
0036 }  // namespace Acts::detail