VIPRA Documentation
Loading...
Searching...
No Matches
find_index.hpp
1#pragma once
2
3#include <cstddef>
4
5namespace VIPRA::Util {
6template <std::size_t index_t, template <typename> typename check_t, typename... types_t>
7struct FindIndex;
8
9template <std::size_t index_t, template <typename> typename check_t, typename type_t,
10 typename... types_t>
11struct FindIndex<index_t, check_t, type_t, types_t...> {
12 // NOLINTNEXTLINE(readability-identifier-naming) lowercase is a regular naming convetion here
13 static constexpr std::size_t value =
14 check_t<type_t>::value ? index_t
15 : FindIndex<index_t + 1, check_t, types_t...>::value;
16};
17
24template <std::size_t index_t, template <typename> typename check_t>
25struct FindIndex<index_t, check_t> {
26 // NOLINTNEXTLINE(readability-identifier-naming) lowercase is a regular naming convetion here
27 static constexpr std::size_t value = -1;
28};
29} // namespace VIPRA::Util
Definition find_index.hpp:7