Blaze 3.9
Rank.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_UTIL_TYPETRAITS_RANK_H_
36#define _BLAZE_UTIL_TYPETRAITS_RANK_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44
45
46namespace blaze {
47
48//=================================================================================================
49//
50// CLASS DEFINITION
51//
52//=================================================================================================
53
54//*************************************************************************************************
71template< typename T >
72struct Rank
73 : public IntegralConstant<size_t,0UL>
74{};
75//*************************************************************************************************
76
77
78//*************************************************************************************************
80
81template< typename T >
82struct Rank<T[]>
83 : public IntegralConstant<size_t,1UL+Rank<T>::value>
84{};
86//*************************************************************************************************
87
88
89//*************************************************************************************************
91
92template< typename T, unsigned int N >
93struct Rank<T[N]>
94 : public IntegralConstant<size_t,1UL+Rank<T>::value>
95{};
97//*************************************************************************************************
98
99
100//*************************************************************************************************
113template< typename T >
114constexpr size_t Rank_v = Rank<T>::value;
115//*************************************************************************************************
116
117} // namespace blaze
118
119#endif
Header file for the IntegralConstant class template.
constexpr size_t Rank_v
Auxiliary variable template for the Rank type trait.
Definition: Rank.h:114
Generic wrapper for a compile time constant integral value.
Definition: IntegralConstant.h:74
Compile time check for array ranks.
Definition: Rank.h:74