Blaze 3.9
SubvectorTrait.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_TRAITS_SUBVECTORTRAIT_H_
36#define _BLAZE_MATH_TRAITS_SUBVECTORTRAIT_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <utility>
44#include <blaze/math/Infinity.h>
45#include <blaze/util/Types.h>
46
47
48namespace blaze {
49
50//=================================================================================================
51//
52// CLASS DEFINITION
53//
54//=================================================================================================
55
56//*************************************************************************************************
58template< typename, size_t... > struct SubvectorTrait;
59template< typename, size_t, size_t, typename = void > struct SubvectorTraitEval1;
60template< typename, size_t, size_t, typename = void > struct SubvectorTraitEval2;
62//*************************************************************************************************
63
64
65//*************************************************************************************************
67template< size_t I, size_t N, typename T >
68auto evalSubvectorTrait( const volatile T& ) -> SubvectorTraitEval1<T,I,N>;
69
70template< typename T >
71auto evalSubvectorTrait( const volatile T& ) -> SubvectorTraitEval1<T,inf,inf>;
73//*************************************************************************************************
74
75
76//*************************************************************************************************
122template< typename VT // Type of the vector
123 , size_t... CSAs > // Compile time subvector arguments
125 : public decltype( evalSubvectorTrait<CSAs...>( std::declval<VT&>() ) )
126{};
127//*************************************************************************************************
128
129
130//*************************************************************************************************
143template< typename VT // Type of the vector
144 , size_t... CSAs > // Compile time subvector arguments
145using SubvectorTrait_t = typename SubvectorTrait<VT,CSAs...>::Type;
146//*************************************************************************************************
147
148
149//*************************************************************************************************
154template< typename VT // Type of the vector
155 , size_t I // Index of the first element
156 , size_t N // Number of elements
157 , typename > // Restricting condition
158struct SubvectorTraitEval1
159 : public SubvectorTraitEval2<VT,I,N>
160{};
162//*************************************************************************************************
163
164
165//*************************************************************************************************
170template< typename VT // Type of the vector
171 , size_t I // Index of the first element
172 , size_t N // Number of elements
173 , typename > // Restricting condition
174struct SubvectorTraitEval2
175{};
177//*************************************************************************************************
178
179} // namespace blaze
180
181#endif
Numerical infinity for built-in data types.
typename SubvectorTrait< VT, CSAs... >::Type SubvectorTrait_t
Auxiliary alias declaration for the SubvectorTrait type trait.
Definition: SubvectorTrait.h:145
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:126
Header file for basic type definitions.