Blaze 3.9
blaze::IndexOf< TL, T > Struct Template Reference

Searching a type list. More...

Detailed Description

template<typename TL, typename T>
struct blaze::IndexOf< TL, T >

Searching a type list.

The IndexOf class can be used to search the type list for a particular type Type. In contrast to the Contains and the ContainsRelated classes, the IndexOf class evaluates the index of the given type in the type list. In case the type is contained in the type list, the value member represents the index of the queried type. Otherwise the value member is set to the length of the type list. In order to search for a type, the IndexOf class has to be instantiated for a particular type list and a search type. The following example gives an impression of the use of the IndexOf class:

using Floats = blaze::TypeList< float, double, long double >; // Defining a new type list
constexpr bool index1 = blaze::IndexOf< Floats, double >::value; // Value evaluates to 1
constexpr bool index2 = blaze::IndexOf< Floats, int >::value; // Value evaluates to -1
Searching a type list.
Definition: IndexOf.h:75
Implementation of a type list.
Definition: TypeList.h:120

The documentation for this struct was generated from the following file: