31#ifndef ETL_INTEGRAL_LIMITS_INCLUDED
32#define ETL_INTEGRAL_LIMITS_INCLUDED
49 #define LLONG_MAX 9223372036854775807LL
53 #define LLONG_MIN (-LLONG_MAX - 1LL)
57 #define ULLONG_MAX 18446744073709551615ULL
62 namespace private_integral_limits
75 template <
typename T =
void>
78 typedef signed char value_type;
80 static ETL_CONSTANT
signed char min = SCHAR_MIN;
81 static ETL_CONSTANT
signed char max = SCHAR_MAX;
82 static ETL_CONSTANT
int bits = CHAR_BIT;
100 template <
typename T =
void>
103 typedef unsigned char value_type;
105 static ETL_CONSTANT
unsigned char min = 0;
106 static ETL_CONSTANT
unsigned char max = UCHAR_MAX;
107 static ETL_CONSTANT
int bits = CHAR_BIT;
111 template <
typename T>
114 template <
typename T>
117 template <
typename T>
120 template <
typename T>
125 template <
typename T =
void>
128 typedef char value_type;
132 static ETL_CONSTANT
int bits = CHAR_BIT;
136 template <
typename T>
139 template <
typename T>
142 template <
typename T>
145 template <
typename T>
150 template <
typename T =
void>
153 typedef wchar_t value_type;
155 static ETL_CONSTANT
wchar_t min = WCHAR_MIN;
156 static ETL_CONSTANT
wchar_t max = WCHAR_MAX;
157 static ETL_CONSTANT
int bits = CHAR_BIT *
sizeof(wchar_t);
161 template <
typename T>
164 template <
typename T>
167 template <
typename T>
170 template <
typename T>
175#if defined(ETL_COMPILER_MICROSOFT)
176 #pragma warning(push)
177 #pragma warning(disable : 4309)
180 template <
typename T =
void>
183 typedef short value_type;
185 static ETL_CONSTANT
short min = SHRT_MIN;
186 static ETL_CONSTANT
short max = SHRT_MAX;
187 static ETL_CONSTANT
int bits = CHAR_BIT * (
sizeof(short) /
sizeof(
char));
191 template <
typename T>
194 template <
typename T>
197 template <
typename T>
200 template <
typename T>
203#if defined(ETL_COMPILER_MICROSOFT)
209 template <
typename T =
void>
212 typedef unsigned short value_type;
214 static ETL_CONSTANT
unsigned short min = 0;
215 static ETL_CONSTANT
unsigned short max = USHRT_MAX;
216 static ETL_CONSTANT
int bits = CHAR_BIT * (
sizeof(
unsigned short) /
sizeof(
char));
220 template <
typename T>
223 template <
typename T>
226 template <
typename T>
229 template <
typename T>
234 template <
typename T =
void>
237 typedef int value_type;
239 static ETL_CONSTANT
int min = INT_MIN;
240 static ETL_CONSTANT
int max = INT_MAX;
241 static ETL_CONSTANT
int bits = CHAR_BIT * (
sizeof(int) /
sizeof(
char));
245 template <
typename T>
248 template <
typename T>
251 template <
typename T>
254 template <
typename T>
259 template <
typename T =
void>
262 typedef unsigned int value_type;
264 static ETL_CONSTANT
unsigned int min = 0;
265 static ETL_CONSTANT
unsigned int max = UINT_MAX;
266 static ETL_CONSTANT
int bits = CHAR_BIT * (
sizeof(
unsigned int) /
sizeof(
char));
270 template <
typename T>
273 template <
typename T>
276 template <
typename T>
279 template <
typename T>
284 template <
typename T =
void>
287 typedef long value_type;
289 static ETL_CONSTANT
long min = LONG_MIN;
290 static ETL_CONSTANT
long max = LONG_MAX;
291 static ETL_CONSTANT
int bits = CHAR_BIT * (
sizeof(long) /
sizeof(
char));
295 template <
typename T>
298 template <
typename T>
301 template <
typename T>
304 template <
typename T>
309 template <
typename T =
void>
312 typedef unsigned long value_type;
314 static ETL_CONSTANT
unsigned long min = 0;
315 static ETL_CONSTANT
unsigned long max = ULONG_MAX;
316 static ETL_CONSTANT
int bits = CHAR_BIT * (
sizeof(
unsigned long) /
sizeof(
char));
320 template <
typename T>
323 template <
typename T>
326 template <
typename T>
329 template <
typename T>
334 template <
typename T =
void>
337 typedef long long value_type;
339 static ETL_CONSTANT
long long min = LLONG_MIN;
340 static ETL_CONSTANT
long long max = LLONG_MAX;
341 static ETL_CONSTANT
int bits = CHAR_BIT * (
sizeof(
long long) /
sizeof(
char));
345 template <
typename T>
348 template <
typename T>
351 template <
typename T>
354 template <
typename T>
359 template <
typename T =
void>
362 typedef unsigned long value_type;
364 static ETL_CONSTANT
unsigned long long min = 0;
365 static ETL_CONSTANT
unsigned long long max = ULLONG_MAX;
366 static ETL_CONSTANT
int bits = CHAR_BIT * (
sizeof(
unsigned long long) /
sizeof(
char));
370 template <
typename T>
373 template <
typename T>
376 template <
typename T>
379 template <
typename T>
382#if ETL_HAS_NATIVE_CHAR8_T
385 template <
typename T =
void>
386 struct statics_char8_t
388 typedef char8_t value_type;
392 static ETL_CONSTANT
int bits = CHAR_BIT;
396 template <
typename T>
397 ETL_CONSTANT
char8_t statics_char8_t<T>::min;
399 template <
typename T>
400 ETL_CONSTANT
char8_t statics_char8_t<T>::max;
402 template <
typename T>
403 ETL_CONSTANT
int statics_char8_t<T>::bits;
405 template <
typename T>
406 ETL_CONSTANT
bool statics_char8_t<T>::is_signed;
409#if ETL_HAS_NATIVE_CHAR16_T
412 template <
typename T =
void>
413 struct statics_char16_t
415 typedef char16_t value_type;
417 static ETL_CONSTANT
char16_t min = 0;
418 static ETL_CONSTANT
char16_t max = 0xFFFFU;
419 static ETL_CONSTANT
int bits = 16;
420 static ETL_CONSTANT
bool is_signed =
false;
423 template <
typename T>
424 ETL_CONSTANT
char16_t statics_char16_t<T>::min;
426 template <
typename T>
427 ETL_CONSTANT
char16_t statics_char16_t<T>::max;
429 template <
typename T>
430 ETL_CONSTANT
int statics_char16_t<T>::bits;
432 template <
typename T>
433 ETL_CONSTANT
bool statics_char16_t<T>::is_signed;
436#if ETL_HAS_NATIVE_CHAR32_T
439 template <
typename T =
void>
440 struct statics_char32_t
442 typedef char32_t value_type;
444 static ETL_CONSTANT
char32_t min = 0;
445 static ETL_CONSTANT
char32_t max = 0xFFFFFFFFU;
446 static ETL_CONSTANT
int bits = 32;
447 static ETL_CONSTANT
bool is_signed =
false;
450 template <
typename T>
451 ETL_CONSTANT
char32_t statics_char32_t<T>::min;
453 template <
typename T>
454 ETL_CONSTANT
char32_t statics_char32_t<T>::max;
456 template <
typename T>
457 ETL_CONSTANT
int statics_char32_t<T>::bits;
459 template <
typename T>
460 ETL_CONSTANT
bool statics_char32_t<T>::is_signed;
467 template <
typename T>
493 typedef char value_type;
Definition: integral_limits.h:468
is_signed
Definition: type_traits_generator.h:1011
bitset_ext
Definition: absolute.h:38
Definition: integral_limits.h:127
Definition: integral_limits.h:236
Definition: integral_limits.h:336
Definition: integral_limits.h:286
Definition: integral_limits.h:182
Definition: integral_limits.h:77
Definition: integral_limits.h:102
Definition: integral_limits.h:261
Definition: integral_limits.h:361
Definition: integral_limits.h:311
Definition: integral_limits.h:211
Definition: integral_limits.h:152