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>
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>
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>
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>
155 static ETL_CONSTANT
wchar_t min = WCHAR_MIN;
156 static ETL_CONSTANT
wchar_t max = WCHAR_MAX;
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>
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>
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>
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>
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>
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>
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>
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>
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>
388 typedef char8_t value_type;
392 static ETL_CONSTANT
int bits =
CHAR_BIT;
396 template <
typename T>
399 template <
typename T>
402 template <
typename T>
405 template <
typename T>
409#if ETL_HAS_NATIVE_CHAR16_T
412 template <
typename T =
void>
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;
463#if ETL_USING_20BIT_TYPES
464template <
typename T =
void>
465 struct statics___int20
467 typedef __int20 value_type;
469 static ETL_CONSTANT __int20 min = 0x80000;
470 static ETL_CONSTANT __int20 max = 0x7FFFF;
471 static ETL_CONSTANT
int bits = 20;
472 static ETL_CONSTANT
bool is_signed =
true;
475 template <
typename T>
476 ETL_CONSTANT __int20 statics___int20<T>::min;
478 template <
typename T>
479 ETL_CONSTANT __int20 statics___int20<T>::max;
481 template <
typename T>
482 ETL_CONSTANT
int statics___int20<T>::bits;
484 template <
typename T>
485 ETL_CONSTANT
bool statics___int20<T>::is_signed;
487 template <
typename T =
void>
488 struct statics_unsigned___int20
490 typedef unsigned __int20 value_type;
492 static ETL_CONSTANT
unsigned __int20 min = 0;
493 static ETL_CONSTANT
unsigned __int20 max = 0xFFFFF;
494 static ETL_CONSTANT
int bits = 20;
495 static ETL_CONSTANT
bool is_signed =
false;
498 template <
typename T>
499 ETL_CONSTANT
unsigned __int20 statics_unsigned___int20<T>::min;
501 template <
typename T>
502 ETL_CONSTANT
unsigned __int20 statics_unsigned___int20<T>::max;
504 template <
typename T>
505 ETL_CONSTANT
int statics_unsigned___int20<T>::bits;
507 template <
typename T>
508 ETL_CONSTANT
bool statics_unsigned___int20<T>::is_signed;
515 template <
typename T>
608 #if ETL_USING_20BIT_TYPES
618 struct integral_limits<unsigned __int20> :
public private_integral_limits::statics_unsigned___int20<>
Definition integral_limits.h:516
is_signed
Definition type_traits_generator.h:1006
bitset_ext
Definition absolute.h:38
pair holds two objects of arbitrary type
Definition utility.h:164
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