Elementa v8.0.0
Minimalistic library for any C++ application (C++11 and up)
Loading...
Searching...
No Matches
checks.inc
1
3#include "elementa/license.inc"
4
5#ifndef ELEMENTA_CHECKS_INC
6#define ELEMENTA_CHECKS_INC
7
8#include <limits>
9
30/* ***************************************************************************
31
32 Macro: ELE_PRE_CPPVER
33
34*****************************************************************************/
35
37
38#if __cplusplus == 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900 && _MSC_VER < 1910)
39 #define ELE_PRE_CPPVER 2011
40#elif __cplusplus == 201402L || (defined(_MSC_VER) && _MSC_VER >= 1910 && _MSC_VER < 1914)
41 #define ELE_PRE_CPPVER 2014
42#elif __cplusplus == 201703L || (defined(_MSC_VER) && _MSC_VER >= 1914)
43 #define ELE_PRE_CPPVER 2017
44#else
45 #error Version of the C++ standard not decided or less than C++11.
46#endif
47
48
49/* ***************************************************************************
50
51 Check for 8 bit integral support.
52
53*****************************************************************************/
54
56
57static_assert(std::numeric_limits<unsigned char>::digits == 8,
58 "Elementa needs that unsigned char has 8 bits");
59
60
61/* ***************************************************************************
62
63 Check for existence of infinity and NaN in floats and doubles.
64
65*****************************************************************************/
66
67static_assert(std::numeric_limits<float>::is_iec559 &&
68 std::numeric_limits<double>::is_iec559,
69 "Elementa needs that float and double satisfy IEC559 in order to"
70 " have infinity");
71
74#endif