Core Numeric Types#

group core_numeric_types

Hyperion provides type aliases for fixed-width integer and floating point types, as well as the platform native size-type, byte, and maximum-width integer and floating point types. It also provides user-defined literals for each that support numeric separators (eg “12’345”) and provide bounds checking to ensure a literal is not out of the range of its associated type.

Example#

using hyperion::operator""_f32;
const auto my_f32 = 12'345.6789_f32;

Typedefs

using u8 = uint8_t#

u8 is an 8-bit unsigned integer

using u16 = uint16_t#

u16 is an 16-bit unsigned integer

using u32 = uint32_t#

u32 is an 32-bit unsigned integer

using u64 = uint64_t#

u64 is an 64-bit unsigned integer

using usize = size_t#

usize is the unsigned integer type best suited for sizes on the given platform (size_t)

using umax = uintmax_t#

umax is the largest unsigned integer on the platform (uintmax_t)

using i8 = int8_t#

i8 is an 8-bit signed integer

using i16 = int16_t#

i16 is a 16-bit signed integer

using i32 = int32_t#

i32 is a 32-bit signed integer

using i64 = int64_t#

i64 is a 64-bit signed integer

using imax = intmax_t#

imax is the largest signed integer on the platform (intmax_t)

using byte = unsigned char#

byte is a single-byte unsigned integer

using f32 = float#

f32 is a single-precision (32-bit) floating point number

using f64 = double#

f64 is a double-precision (64-bit) floating point number

using fmax = long double#

fmax is the largest-precision floating point number on the platform (long double)

Functions

template<char... Chars>
static constexpr auto operator""_byte() noexcept -> byte#

user defined literal for byte

Example#

using hyperion::operator""_byte;
const auto my_byte = 12'345_byte;
template<char... Chars>
static constexpr auto operator""_u8() noexcept -> u8#

user defined literal for u8

Example#

using hyperion::operator""_u8;
const auto my_u8 = 12'345_u8;
template<char... Chars>
static constexpr auto operator""_u16() noexcept -> u16#

user defined literal for u16

Example#

using hyperion::operator""_u16;
const auto my_u16 = 12'345_16;
template<char... Chars>
static constexpr auto operator""_u32() noexcept -> u32#

user defined literal for u32

Example#

using hyperion::operator""_u32;
const auto my_u32 = 12'345_u32;
template<char... Chars>
static constexpr auto operator""_u64() noexcept -> u64#

user defined literal for u64

Example#

using hyperion::operator""_u64;
const auto my_u64 = 12'345_u64;
template<char... Chars>
static constexpr auto operator""_usize() noexcept -> usize#

user defined literal for usize

Example#

using hyperion::operator""_usize;
const auto my_usize = 12'345_usize;
template<char... Chars>
static constexpr auto operator""_umax() noexcept -> umax#

user defined literal for umax

Example#

using hyperion::operator""_umax;
const auto my_umax = 12'345_umax;
template<char... Chars>
static constexpr auto operator""_i8() noexcept -> i8#

user defined literal for i8

Example#

using hyperion::operator""_i8;
const auto my_i8 = 12'345_i8;
template<char... Chars>
static constexpr auto operator""_i16() noexcept -> i16#

user defined literal for i16

Example#

using hyperion::operator""_i16;
const auto my_i16 = 12'345_i16;
template<char... Chars>
static constexpr auto operator""_i32() noexcept -> i32#

user defined literal for i32

Example#

using hyperion::operator""_i32;
const auto my_i32 = 12'345_i32;
template<char... Chars>
static constexpr auto operator""_i64() noexcept -> i64#

user defined literal for i64

Example#

using hyperion::operator""_i64;
const auto my_i64 = 12'345_i64;
template<char... Chars>
static constexpr auto operator""_imax() noexcept -> imax#

user defined literal for imax

Example#

using hyperion::operator""_imax;
const auto my_imax = 12'345_imax;
template<char... Chars>
static constexpr auto operator""_f32() noexcept -> f32#

user defined literal for f32

Example#

using hyperion::operator""_f32;
const auto my_f32 = 12'345.6789_f32;
template<char... Chars>
static constexpr auto operator""_f64() noexcept -> f64#

user defined literal for f64

Example#

using hyperion::operator""_f64;
const auto my_f64 = 12'345.6789_f64;
template<char... Chars>
static constexpr auto operator""_fmax() noexcept -> fmax#

user defined literal for fmax

Example#

using hyperion::operator""_fmax;
const auto my_fmax = 12'345.6789_fmax;