AlignedStorage.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_ALIGNEDSTORAGE_H_
36 #define _BLAZE_UTIL_ALIGNEDSTORAGE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/system/Alignment.h>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // CLASS DEFINITION
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
62 template< size_t Alignment >
63 struct AlignedStorageHelper;
65 //*************************************************************************************************
66 
67 
68 //*************************************************************************************************
73 template<>
74 struct BLAZE_ALIGN( 1UL ) AlignedStorageHelper<1UL>
75 {};
77 //*************************************************************************************************
78 
79 
80 //*************************************************************************************************
85 template<>
86 struct BLAZE_ALIGN( 2UL ) AlignedStorageHelper<2UL>
87 {};
89 //*************************************************************************************************
90 
91 
92 //*************************************************************************************************
97 template<>
98 struct BLAZE_ALIGN( 4UL ) AlignedStorageHelper<4UL>
99 {};
101 //*************************************************************************************************
102 
103 
104 //*************************************************************************************************
109 template<>
110 struct BLAZE_ALIGN( 8UL ) AlignedStorageHelper<8UL>
111 {};
113 //*************************************************************************************************
114 
115 
116 //*************************************************************************************************
121 template<>
122 struct BLAZE_ALIGN( 16UL ) AlignedStorageHelper<16UL>
123 {};
125 //*************************************************************************************************
126 
127 
128 //*************************************************************************************************
133 template<>
134 struct BLAZE_ALIGN( 32UL ) AlignedStorageHelper<32UL>
135 {};
137 //*************************************************************************************************
138 
139 
140 //*************************************************************************************************
145 template<>
146 struct BLAZE_ALIGN( 64UL ) AlignedStorageHelper<64UL>
147 {};
149 //*************************************************************************************************
150 
151 
152 //*************************************************************************************************
157 template<>
158 struct BLAZE_ALIGN( 128UL ) AlignedStorageHelper<128UL>
159 {};
161 //*************************************************************************************************
162 
163 
164 //*************************************************************************************************
169 template<>
170 struct BLAZE_ALIGN( 256UL ) AlignedStorageHelper<256UL>
171 {};
173 //*************************************************************************************************
174 
175 
176 //*************************************************************************************************
205 template< typename T >
206 class AlignedStorage : private AlignedStorageHelper< AlignmentOf<T>::value >
207 {
208  //**Compile time checks*************************************************************************
213  //**********************************************************************************************
214 };
215 //*************************************************************************************************
216 
217 } // namespace blaze
218 
219 #endif
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:116
Header file for the AlignmentOf type trait.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:116
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Constraint on the data type.
POD data type with a fixed alignment.The AlignedStorage class template represents a POD data type wit...
Definition: AlignedStorage.h:206
Constraint on the data type.
System specific memory alignment definitions.