srsLTE/lib/include/srsran/adt/detail/index_sequence.h

37 lines
825 B
C
Raw Normal View History

2020-12-10 09:56:44 -08:00
/**
*
* \section COPYRIGHT
*
2021-03-19 03:45:56 -07:00
* Copyright 2013-2021 Software Radio Systems Limited
2020-12-10 09:56:44 -08:00
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the distribution.
*
*/
#ifndef CPP_TESTS_INDEX_SEQUENCE_H
#define CPP_TESTS_INDEX_SEQUENCE_H
#include <cstddef>
2021-03-19 03:45:56 -07:00
namespace srsran {
2020-12-10 09:56:44 -08:00
template <std::size_t...>
struct index_sequence {};
template <std::size_t N, std::size_t... Next>
struct index_sequence_helper : public index_sequence_helper<N - 1U, N - 1U, Next...> {};
template <std::size_t... Next>
struct index_sequence_helper<0U, Next...> {
using type = index_sequence<Next...>;
};
template <std::size_t N>
using make_index_sequence = typename index_sequence_helper<N>::type;
2021-03-19 03:45:56 -07:00
} // namespace srsran
2020-12-10 09:56:44 -08:00
#endif // CPP_TESTS_INDEX_SEQUENCE_H