Blaze  3.6
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 
44 #include <blaze/util/mpl/If.h>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // CLASS TEMPLATE
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
88 template< typename TL // Type of the type list
89  , typename T > // The search type
91 //*************************************************************************************************
92 
93 
94 //*************************************************************************************************
99 template< typename T > // The search type
100 struct ContainsRelated< TypeList<>, T >
101  : public FalseType
102 {};
104 //*************************************************************************************************
105 
106 
107 //*************************************************************************************************
112 template< typename U // Type of the head of the type list
113  , typename... Ts // Types of the tail of the type list
114  , typename T > // The search type
115 struct ContainsRelated< TypeList<U,Ts...>, T >
116  : public If_t< IsConvertible_v<T,U>
117  , TrueType
118  , ContainsRelated< TypeList<Ts...>, T > >
119 {};
121 //*************************************************************************************************
122 
123 
124 //*************************************************************************************************
137 template< typename TL // Type of the type list
138  , typename T > // The search type
140 //*************************************************************************************************
141 
142 } // namespace blaze
143 
144 #endif
typename If< Condition, T1, T2 >::Type If_t
Auxiliary alias template for the If class template.The If_t alias template provides a convenient shor...
Definition: If.h:109
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:72
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:90
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:139
Header file for the TypeList class template.
Header file for the IntegralConstant class template.