SubvectorExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_SUBVECTOREXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_SUBVECTOREXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
47 #include <blaze/util/InvalidType.h>
48 #include <blaze/util/mpl/If.h>
50 
51 
52 namespace blaze {
53 
54 //=================================================================================================
55 //
56 // CLASS DEFINITION
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
69 template< typename VT // Type of the vector operand
70  , AlignmentFlag AF = unaligned // Alignment Flag
71  , size_t... CSAs > // Compile time subvector arguments
73 {
74  private:
75  //**********************************************************************************************
77  struct Failure { using Type = INVALID_TYPE; };
79  //**********************************************************************************************
80 
81  //**********************************************************************************************
83  struct CompileTime { using Type = decltype( subvector<AF,CSAs...>( std::declval<VT>() ) ); };
85  //**********************************************************************************************
86 
87  //**********************************************************************************************
89  struct Runtime { using Type = decltype( subvector<AF>( std::declval<VT>()
90  , std::declval<size_t>()
91  , std::declval<size_t>() ) ); };
93  //**********************************************************************************************
94 
95  public:
96  //**********************************************************************************************
98  using Type = typename If_< IsVector< RemoveReference_<VT> >
99  , IfTrue_< ( sizeof...( CSAs ) > 0UL )
100  , CompileTime
101  , Runtime >
102  , Failure >::Type;
104  //**********************************************************************************************
105 };
106 //*************************************************************************************************
107 
108 
109 //*************************************************************************************************
122 template< typename VT // Type of the vector operand
123  , AlignmentFlag AF = unaligned // Alignment Flag
124  , size_t... CSAs > // Compile time subvector arguments
125 using SubvectorExprTrait_ = typename SubvectorExprTrait<VT,AF,CSAs...>::Type;
126 //*************************************************************************************************
127 
128 } // namespace blaze
129 
130 #endif
AlignmentFlag
Alignment flag for (un-)aligned vectors and matrices.Via these flags it is possible to specify subvec...
Definition: AlignmentFlag.h:62
Evaluation of the expression type type of a subvector operation.Via this type trait it is possible to...
Definition: SubvectorExprTrait.h:72
Header file for the alignment flag values.
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the IsVector type trait.
Header file for all forward declarations for views.
Utility type for generic codes.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
Header file for the RemoveReference type trait.
Flag for unaligned vectors and matrices.
Definition: AlignmentFlag.h:64
typename SubvectorExprTrait< VT, AF, CSAs... >::Type SubvectorExprTrait_
Auxiliary alias declaration for the SubvectorExprTrait type trait.The SubvectorExprTrait_ alias decla...
Definition: SubvectorExprTrait.h:125