All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
blaze::ContainsRelated< TList, Type > Class Template Reference

Searching a type list.The ContainsRelated class can be used to search the type list for a type related to Type. In contrast to the Contains class, the ContainsRelated class only searches for a type the given data type Type can be converted to. In case a related type is found in the type list, the value member enumeration is set to 1, else it is set to 0. In order to check whether a related type is contained in the type list, the ContainsRelated class has to be instantiated for a particular type list and another type. The following example gives an impression of the use of the ContainsRelated class: More...

#include <TypeList.h>

Detailed Description

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

Searching a type list.

The ContainsRelated class can be used to search the type list for a type related to Type. In contrast to the Contains class, the ContainsRelated class only searches for a type the given data type Type can be converted to. In case a related type is found in the type list, the value member enumeration is set to 1, else it is set to 0. In order to check whether a related type is contained in the type list, the ContainsRelated class has to be instantiated for a particular type list and another type. The following example gives an impression of the use of the ContainsRelated class:

class A {};
class B : public A {};
class C {};
class D {};
// Defining a new type list
typedef BLAZE_TYPELIST_2( A, C ) Types;
// Searching for the type A in the type list
const int a = blaze::ContainsRelated< Types, A >::value; // Evaluates to 1, type A is found
// Searching for the derived type B in the type list
const int b = blaze::ContainsRelated< Types, B >::value; // Evaluates to 1, base type A is found
// Searching for the type C in the type list
const int c = blaze::ContainsRelated< Types, D >::value; // Evaluates to 0, no related type found

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