RowsTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_ROWSTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_ROWSTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <blaze/util/InvalidType.h>
45 #include <blaze/util/Types.h>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // CLASS DEFINITION
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
58 template< typename, size_t > struct RowsTrait;
59 template< typename, size_t, typename = void > struct RowsTraitEval1;
60 template< typename, size_t, typename = void > struct RowsTraitEval2;
62 //*************************************************************************************************
63 
64 
65 //*************************************************************************************************
67 template< size_t M, typename T >
68 auto evalRowsTrait( T& )
69  -> typename RowsTraitEval1<T,M>::Type;
70 
71 template< size_t M, typename T >
72 auto evalRowsTrait( const T& )
73  -> typename RowsTrait<T,M>::Type;
74 
75 template< size_t M , typename T >
76 auto evalRowsTrait( const volatile T& )
77  -> typename RowsTrait<T,M>::Type;
79 //*************************************************************************************************
80 
81 
82 //*************************************************************************************************
128 template< typename MT // Type of the matrix
129  , size_t M > // Number of compile time indices
130 struct RowsTrait
131 {
132  public:
133  //**********************************************************************************************
135  using Type = decltype( evalRowsTrait<M>( std::declval<MT&>() ) );
137  //**********************************************************************************************
138 };
139 //*************************************************************************************************
140 
141 
142 //*************************************************************************************************
155 template< typename MT // Type of the matrix
156  , size_t M > // Number of compile time indices
158 //*************************************************************************************************
159 
160 
161 //*************************************************************************************************
166 template< typename MT // Type of the matrix
167  , size_t M // Number of compile time indices
168  , typename > // Restricting condition
169 struct RowsTraitEval1
170 {
171  public:
172  //**********************************************************************************************
173  using Type = typename RowsTraitEval2<MT,M>::Type;
174  //**********************************************************************************************
175 };
177 //*************************************************************************************************
178 
179 
180 //*************************************************************************************************
185 template< typename MT // Type of the matrix
186  , size_t M // Number of compile time indices
187  , typename > // Restricting condition
188 struct RowsTraitEval2
189 {
190  public:
191  //**********************************************************************************************
192  using Type = INVALID_TYPE;
193  //**********************************************************************************************
194 };
196 //*************************************************************************************************
197 
198 } // namespace blaze
199 
200 #endif
Header file for basic type definitions.
Base template for the RowsTrait class.
Definition: RowsTrait.h:130
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Utility type for generic codes.
typename RowsTrait< MT, M >::Type RowsTrait_t
Auxiliary alias declaration for the RowsTrait type trait.The RowsTrait_t alias declaration provides a...
Definition: RowsTrait.h:157