Blaze 3.9
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
49namespace blaze {
50
51//=================================================================================================
52//
53// CLASS TEMPLATE
54//
55//=================================================================================================
56
57//*************************************************************************************************
88template< typename TL // Type of the type list
89 , typename T > // The search type
91//*************************************************************************************************
92
93
94//*************************************************************************************************
99template< typename T > // The search type
100struct ContainsRelated< TypeList<>, T >
101 : public FalseType
102{};
104//*************************************************************************************************
105
106
107//*************************************************************************************************
112template< 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
115struct 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//*************************************************************************************************
137template< typename TL // Type of the type list
138 , typename T > // The search type
140//*************************************************************************************************
141
142} // namespace blaze
143
144#endif
Header file for the If class template.
Header file for the IntegralConstant class template.
Header file for the IsConvertible type trait.
constexpr bool ContainsRelated_v
Auxiliary variable template for the ContainsRelated type trait.
Definition: ContainsRelated.h:139
typename If< Condition >::template Type< T1, T2 > If_t
Auxiliary alias template for the If class template.
Definition: If.h:108
Searching a type list.
Definition: ContainsRelated.h:90
Generic wrapper for a compile time constant integral value.
Definition: IntegralConstant.h:74
Implementation of a type list.
Definition: TypeList.h:120
Header file for the TypeList class template.