Find the first index where a type appears in a list of types.
Declared in <llvm/ADT/STLExtras.h>
template<
typename T,
typename... Us>
struct FirstIndexOfType;
FirstIndexOfType<T, Us...>::value is the first index of T in Us.
Typically only meaningful when it is otherwise statically known that the type pack has no duplicate types. This should be guaranteed explicitly with static_assert(TypesAreDistinct<Us...>::value).
It is a compile-time error to instantiate when T is not present in Us, i.e. if is_one_of<T, Us...>::value is false.
| Name | Description |
|---|---|
FirstIndexOfType<T, T, Us...> | Specialization when the head type matches T index is zero. |
FirstIndexOfType<T, U, Us...> | Specialization when the head type differs from T continue searching. |