43 static constexpr bool is_int =
false;
49 static constexpr T max = std::numeric_limits<T>::max();
52 static constexpr T min = std::numeric_limits<T>::lowest();
55 static constexpr T epsilon = std::numeric_limits<T>::epsilon();
58 static constexpr T infty = std::numeric_limits<T>::infinity();
65 static constexpr bool is_float =
false;
66 static constexpr bool is_int =
false;
71 struct primitive_type_info<
const _T> :
public primitive_type_info<_T> {};
74 struct primitive_type_info<
f64> {
78 static constexpr bool is_float =
true;
79 static constexpr bool is_int =
false;
82 static constexpr T max = std::numeric_limits<T>::max();
83 static constexpr T min = std::numeric_limits<T>::lowest();
84 static constexpr T epsilon = std::numeric_limits<T>::epsilon();
85 static constexpr T infty = std::numeric_limits<T>::infinity();
89 struct primitive_type_info<
f32> {
93 static constexpr bool is_float =
true;
94 static constexpr bool is_int =
false;
97 static constexpr T max = std::numeric_limits<T>::max();
98 static constexpr T min = std::numeric_limits<T>::lowest();
99 static constexpr T epsilon = std::numeric_limits<T>::epsilon();
100 static constexpr T infty = std::numeric_limits<T>::infinity();
104 struct primitive_type_info<
i8> {
108 static constexpr bool is_float =
false;
109 static constexpr bool is_int =
true;
112 static constexpr T max = std::numeric_limits<T>::max();
113 static constexpr T min = std::numeric_limits<T>::lowest();
117 struct primitive_type_info<
i16> {
121 static constexpr bool is_float =
false;
122 static constexpr bool is_int =
true;
125 static constexpr T max = std::numeric_limits<T>::max();
126 static constexpr T min = std::numeric_limits<T>::lowest();
130 struct primitive_type_info<
i32> {
134 static constexpr bool is_float =
false;
135 static constexpr bool is_int =
true;
138 static constexpr T max = std::numeric_limits<T>::max();
139 static constexpr T min = std::numeric_limits<T>::lowest();
143 struct primitive_type_info<
i64> {
147 static constexpr bool is_float =
false;
148 static constexpr bool is_int =
true;
151 static constexpr T max = std::numeric_limits<T>::max();
152 static constexpr T min = std::numeric_limits<T>::lowest();
155 struct primitive_type_info<
u8> {
159 static constexpr bool is_float =
false;
160 static constexpr bool is_int =
true;
163 static constexpr T max = std::numeric_limits<T>::max();
164 static constexpr T min = std::numeric_limits<T>::lowest();
168 struct primitive_type_info<
u16> {
172 static constexpr bool is_float =
false;
173 static constexpr bool is_int =
true;
176 static constexpr T max = std::numeric_limits<T>::max();
177 static constexpr T min = std::numeric_limits<T>::lowest();
181 struct primitive_type_info<
u32> {
185 static constexpr bool is_float =
false;
186 static constexpr bool is_int =
true;
189 static constexpr T max = std::numeric_limits<T>::max();
190 static constexpr T min = std::numeric_limits<T>::lowest();
194 struct primitive_type_info<
u64> {
198 static constexpr bool is_float =
false;
199 static constexpr bool is_int =
true;
202 static constexpr T max = std::numeric_limits<T>::max();
203 static constexpr T min = std::numeric_limits<T>::lowest();
double f64
Alias for double.
float f32
Alias for float.
std::int8_t i8
8 bit integer
std::uint8_t u8
8 bit unsigned integer
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
std::uint16_t u16
16 bit unsigned integer
std::int16_t i16
16 bit integer
std::int64_t i64
64 bit integer
std::int32_t i32
32 bit integer
namespace for basic c++ utilities
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
Struct containing information about primitive types.
static constexpr T infty
Infinity if the type can represent it.
static constexpr bool is_unsigned
Whether the type is an unsigned integer type.
_T T
The type of the primitive type.
static constexpr bool is_float
Whether the type is a float type.
static constexpr bool is_int
Whether the type is an integer type.
static constexpr T min
The minimum value of the type (negative if float)
static constexpr T epsilon
The smallest value of the type that can be represented exactly.
static constexpr bool is_specialized
Whether the type is a specialized primitive type (i.e. not a float)
static constexpr T max
The maximum value of the type.