5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_INDEX_OF_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_TYPE_TRAITS_INDEX_OF_HPP_
13#include "arene/base/stdlib_choice/cstddef.hpp"
14#include "arene/base/stdlib_choice/initializer_list.hpp"
15#include "arene/base/stdlib_choice/integral_constant.hpp"
16#include "arene/base/stdlib_choice/is_same.hpp"
17#include "arene/base/type_traits/conditional.hpp"
21namespace index_of_detail {
27constexpr auto index_of_first_true(std::initializer_list<
bool> values)
noexcept -> std::size_t {
30 for (
bool const value : values) {
45constexpr auto index_of_last_true(std::initializer_list<
bool>
const values)
noexcept -> std::size_t {
47 bool const*
const ptr{values.begin()};
48 std::size_t idx{values.size()};
68template <
typename T,
typename... Ts>
69constexpr std::size_t type_index_of_v = index_of_first_true({std::is_same<T, Ts>::value...});
77template <
typename T,
typename... Ts>
78constexpr std::size_t last_type_index_of_v = index_of_last_true({std::is_same<T, Ts>::value...});
82class empty_index_of_base {};
98template <
typename T,
typename... Ts>
113template <
typename T,
typename...
Ts>
127template <
typename T,
typename... Ts>
141template <
typename T,
typename...
Ts>
Template meta-function for querying the 0-based index of a type in a list of types.
Definition index_of.hpp:103
Template meta-function for querying the last 0-based index of a type in a list of types.
Definition index_of.hpp:132
Definition array_exceptions_disabled.cpp:11
constexpr auto last_index_of_v
Template meta-function for querying the last 0-based index of 'T' within a list of types,...
constexpr auto index_of_v
Template meta-function for querying the 0-based index of 'T' within a list of types,...
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10