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_t< IsConvertible_v<T,U>
118  , TrueType
119  , ContainsRelated< TypeList<Ts...>, T > >
120 {};
122 //*************************************************************************************************
123 
124 
125 //*************************************************************************************************
138 template< typename TL // Type of the type list
139  , typename T > // The search type
141 //*************************************************************************************************
142 
143 } // namespace blaze
144 
145 #endif
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias declaration for the If class template.The If_t alias declaration provides a convenien...
Definition: If.h:109
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.
constexpr bool ContainsRelated_v
Auxiliary variable template for the ContainsRelated type trait.The ContainsRelated_v variable templat...
Definition: ContainsRelated.h:140
Header file for the TypeList class template.
Header file for the TrueType type/value trait base class.