CrossTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_CROSSTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_CROSSTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <blaze/util/EnableIf.h>
45 #include <blaze/util/InvalidType.h>
46 #include <blaze/util/mpl/If.h>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // CLASS DEFINITION
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
60 template< typename, typename, typename = void > struct CrossTrait;
61 template< typename, typename, typename = void > struct CrossTraitEval1;
62 template< typename, typename, typename = void > struct CrossTraitEval2;
64 //*************************************************************************************************
65 
66 
67 //*************************************************************************************************
69 template< typename T1, typename T2 >
70 auto evalCrossTrait( T1&, T2& )
71  -> typename CrossTraitEval1<T1,T2>::Type;
72 
73 template< typename T1, typename T2 >
74 auto evalCrossTrait( const T1&, const T2& )
75  -> typename CrossTrait<T1,T2>::Type;
76 
77 template< typename T1, typename T2 >
78 auto evalCrossTrait( const volatile T1&, const T2& )
79  -> typename CrossTrait<T1,T2>::Type;
80 
81 template< typename T1, typename T2 >
82 auto evalCrossTrait( const T1&, const volatile T2& )
83  -> typename CrossTrait<T1,T2>::Type;
84 
85 template< typename T1, typename T2 >
86 auto evalCrossTrait( const volatile T1&, const volatile T2& )
87  -> typename CrossTrait<T1,T2>::Type;
89 //*************************************************************************************************
90 
91 
92 //*************************************************************************************************
136 template< typename T1 // Type of the left-hand side operand
137  , typename T2 // Type of the right-hand side operand
138  , typename > // Restricting condition
140 {
141  public:
142  //**********************************************************************************************
144  using Type = decltype( evalCrossTrait( std::declval<T1&>(), std::declval<T2&>() ) );
146  //**********************************************************************************************
147 };
148 //*************************************************************************************************
149 
150 
151 //*************************************************************************************************
164 template< typename T1, typename T2 >
166 //*************************************************************************************************
167 
168 
169 //*************************************************************************************************
174 template< typename T1 // Type of the left-hand side operand
175  , typename T2 // Type of the right-hand side operand
176  , typename > // Restricting condition
177 struct CrossTraitEval1
178 {
179  public:
180  //**********************************************************************************************
181  using Type = typename CrossTraitEval2<T1,T2>::Type;
182  //**********************************************************************************************
183 };
185 //*************************************************************************************************
186 
187 
188 //*************************************************************************************************
193 template< typename T1 // Type of the left-hand side operand
194  , typename T2 // Type of the right-hand side operand
195  , typename > // Restricting condition
196 struct CrossTraitEval2
197 {
198  public:
199  //**********************************************************************************************
200  using Type = INVALID_TYPE;
201  //**********************************************************************************************
202 };
204 //*************************************************************************************************
205 
206 } // namespace blaze
207 
208 #endif
Base template for the CrossTrait class.
Definition: CrossTrait.h:139
Header file for the Decay type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the EnableIf class template.
typename CrossTrait< T1, T2 >::Type CrossTrait_t
Auxiliary alias declaration for the CrossTrait class template.The CrossTrait_t alias declaration prov...
Definition: CrossTrait.h:165
Utility type for generic codes.