Blaze 3.9
ExpandExprData.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_EXPRESSIONS_EXPANDEXPRDATA_H_
36#define _BLAZE_MATH_EXPRESSIONS_EXPANDEXPRDATA_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <blaze/util/Types.h>
44
45
46namespace blaze {
47
48//=================================================================================================
49//
50// CLASS DEFINITION
51//
52//=================================================================================================
53
54//*************************************************************************************************
62template< size_t... CEAs > // Compile time expansion arguments
64{};
65//*************************************************************************************************
66
67
68
69
70//=================================================================================================
71//
72// CLASS TEMPLATE SPECIALIZATION FOR ZERO COMPILE TIME EXPANSION ARGUMENTS
73//
74//=================================================================================================
75
76//*************************************************************************************************
85template<>
86class ExpandExprData<>
87{
88 public:
89 //**Constructors********************************************************************************
92 inline ExpandExprData( size_t expansion ) noexcept;
93
94 ExpandExprData( const ExpandExprData& ) = default;
96 //**********************************************************************************************
97
98 //**Destructor**********************************************************************************
101 ~ExpandExprData() = default;
103 //**********************************************************************************************
104
105 //**Assignment operators************************************************************************
108 ExpandExprData& operator=( const ExpandExprData& ) = delete;
110 //**********************************************************************************************
111
112 //**Utility functions***************************************************************************
115 inline size_t expansion() const noexcept;
117 //**********************************************************************************************
118
119 private:
120 //**Member variables****************************************************************************
123 const size_t expansion_;
125 //**********************************************************************************************
126};
128//*************************************************************************************************
129
130
131//*************************************************************************************************
137inline ExpandExprData<>::ExpandExprData( size_t expansion ) noexcept
138 : expansion_( expansion ) // The expansion of the expansion expression
139{}
141//*************************************************************************************************
142
143
144//*************************************************************************************************
150inline size_t ExpandExprData<>::expansion() const noexcept
151{
152 return expansion_;
153}
155//*************************************************************************************************
156
157
158
159
160//=================================================================================================
161//
162// CLASS TEMPLATE SPECIALIZATION FOR ONE COMPILE TIME EXPANSION ARGUMENT
163//
164//=================================================================================================
165
166//*************************************************************************************************
175template< size_t E > // Compile time expansion
176class ExpandExprData<E>
177{
178 public:
179 //**Constructors********************************************************************************
182 constexpr ExpandExprData() noexcept;
183
184 ExpandExprData( const ExpandExprData& ) = default;
186 //**********************************************************************************************
187
188 //**Destructor**********************************************************************************
191 ~ExpandExprData() = default;
193 //**********************************************************************************************
194
195 //**Assignment operators************************************************************************
198 ExpandExprData& operator=( const ExpandExprData& ) = delete;
200 //**********************************************************************************************
201
202 //**Utility functions***************************************************************************
205 static constexpr size_t expansion() noexcept;
207 //**********************************************************************************************
208};
210//*************************************************************************************************
211
212
213//*************************************************************************************************
217template< size_t E > // Compile time expansion
218constexpr ExpandExprData<E>::ExpandExprData() noexcept
219{}
221//*************************************************************************************************
222
223
224//*************************************************************************************************
230template< size_t E > // Compile time expansion
231constexpr size_t ExpandExprData<E>::expansion() noexcept
232{
233 return E;
234}
235
237//*************************************************************************************************
238
239} // namespace blaze
240
241#endif
Auxiliary class template for the data members of expansion expression classes.
Definition: ExpandExprData.h:64
Header file for basic type definitions.