ContainsRelated.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_TYPELIST_CONTAINSRELATED_H_
36 #define _BLAZE_UTIL_TYPELIST_CONTAINSRELATED_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/util/FalseType.h>
44 #include <blaze/util/mpl/If.h>
45 #include <blaze/util/TrueType.h>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // CLASS TEMPLATE
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
89 template< typename TL // Type of the type list
90  , typename T > // The search type
92 //*************************************************************************************************
93 
94 
95 //*************************************************************************************************
100 template< typename T > // The search type
101 struct ContainsRelated< TypeList<>, T >
102  : public FalseType
103 {};
105 //*************************************************************************************************
106 
107 
108 //*************************************************************************************************
113 template< typename U // Type of the head of the type list
114  , typename... Ts // Types of the tail of the type list
115  , typename T > // The search type
116 struct ContainsRelated< TypeList<U,Ts...>, T >
117  : public If_< IsConvertible<T,U>
118  , TrueType
119  , ContainsRelated< TypeList<Ts...>, T > >
120 {};
122 //*************************************************************************************************
123 
124 } // namespace blaze
125 
126 #endif
Header file for the FalseType type/value trait base class.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Implementation of a type list.The TypeList class template represents a list of data types of arbitrar...
Definition: TypeList.h:119
Searching a type list.The ContainsRelated class can be used to search the type list for a type relate...
Definition: ContainsRelated.h:91
Header file for the IsConvertible type trait.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
Header file for the TypeList class template.
Header file for the TrueType type/value trait base class.