Blaze 3.9
Extent.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_UTIL_TYPETRAITS_EXTENT_H_
36#define _BLAZE_UTIL_TYPETRAITS_EXTENT_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44#include <blaze/util/Types.h>
45
46
47namespace blaze {
48
49//=================================================================================================
50//
51// CLASS DEFINITION
52//
53//=================================================================================================
54
55//*************************************************************************************************
76template< typename T, size_t N >
77struct Extent
78 : public IntegralConstant<size_t,0UL>
79{};
80//*************************************************************************************************
81
82
83//*************************************************************************************************
85
86template< typename T, size_t N >
87struct Extent<T[],N>
88 : public IntegralConstant<size_t,Extent<T,N-1UL>::value>
89{};
91//*************************************************************************************************
92
93
94//*************************************************************************************************
96
97template< typename T, size_t N, size_t E >
98struct Extent<T[E],N>
99 : public IntegralConstant<size_t,Extent<T,N-1UL>::value>
100{};
102//*************************************************************************************************
103
104
105//*************************************************************************************************
107
108template< typename T >
109struct Extent<T[],0UL>
110 : public IntegralConstant<size_t,0UL>
111{};
113//*************************************************************************************************
114
115
116//*************************************************************************************************
118
119template< typename T, size_t E >
120struct Extent<T[E],0UL>
121 : public IntegralConstant<size_t,E>
122{};
124//*************************************************************************************************
125
126
127//*************************************************************************************************
140template< typename T, size_t N >
141constexpr size_t Extent_v = Extent<T,N>::value;
142//*************************************************************************************************
143
144} // namespace blaze
145
146#endif
Header file for the IntegralConstant class template.
constexpr size_t Extent_v
Auxiliary variable template for the Extent type trait.
Definition: Extent.h:141
Compile time check for the size of array bounds.
Definition: Extent.h:79
Generic wrapper for a compile time constant integral value.
Definition: IntegralConstant.h:74
Header file for basic type definitions.