Blaze  3.6
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>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // CLASS DEFINITION
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
59 template< typename, typename, typename = void > struct CrossTrait;
60 template< typename, typename, typename = void > struct CrossTraitEval1;
61 template< typename, typename, typename = void > struct CrossTraitEval2;
63 //*************************************************************************************************
64 
65 
66 //*************************************************************************************************
68 template< typename T1, typename T2 >
69 auto evalCrossTrait( T1&, T2& )
70  -> typename CrossTraitEval1<T1,T2>::Type;
71 
72 template< typename T1, typename T2 >
73 auto evalCrossTrait( const T1&, const T2& )
74  -> typename CrossTrait<T1,T2>::Type;
75 
76 template< typename T1, typename T2 >
77 auto evalCrossTrait( const volatile T1&, const T2& )
78  -> typename CrossTrait<T1,T2>::Type;
79 
80 template< typename T1, typename T2 >
81 auto evalCrossTrait( const T1&, const volatile T2& )
82  -> typename CrossTrait<T1,T2>::Type;
83 
84 template< typename T1, typename T2 >
85 auto evalCrossTrait( const volatile T1&, const volatile T2& )
86  -> typename CrossTrait<T1,T2>::Type;
88 //*************************************************************************************************
89 
90 
91 //*************************************************************************************************
135 template< typename T1 // Type of the left-hand side operand
136  , typename T2 // Type of the right-hand side operand
137  , typename > // Restricting condition
139 {
140  public:
141  //**********************************************************************************************
143  using Type = decltype( evalCrossTrait( std::declval<T1&>(), std::declval<T2&>() ) );
145  //**********************************************************************************************
146 };
147 //*************************************************************************************************
148 
149 
150 //*************************************************************************************************
163 template< typename T1, typename T2 >
165 //*************************************************************************************************
166 
167 
168 //*************************************************************************************************
173 template< typename T1 // Type of the left-hand side operand
174  , typename T2 // Type of the right-hand side operand
175  , typename > // Restricting condition
176 struct CrossTraitEval1
177 {
178  public:
179  //**********************************************************************************************
180  using Type = typename CrossTraitEval2<T1,T2>::Type;
181  //**********************************************************************************************
182 };
184 //*************************************************************************************************
185 
186 
187 //*************************************************************************************************
192 template< typename T1 // Type of the left-hand side operand
193  , typename T2 // Type of the right-hand side operand
194  , typename > // Restricting condition
195 struct CrossTraitEval2
196 {
197  public:
198  //**********************************************************************************************
199  using Type = INVALID_TYPE;
200  //**********************************************************************************************
201 };
203 //*************************************************************************************************
204 
205 } // namespace blaze
206 
207 #endif
Base template for the CrossTrait class.
Definition: CrossTrait.h:138
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:164
Utility type for generic codes.