blaze::IndexOf< TList, Type > Class Template Reference

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 -1. 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: More...

#include <TypeList.h>

Detailed Description

template<typename TList, typename Type>
class blaze::IndexOf< TList, Type >

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 -1. 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:

typedef BLAZE_TYPELIST_3( float, double, long double ) Floats; // Defining a new type list
const int index1 = blaze::IndexOf< Floats, double >::value; // Value evaluates to 1
const int index2 = blaze::IndexOf< Floats, int >::value; // Value evaluates to -1

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