Basic types

Alias types

  • using u8 = std::uint8_t

    Unsigned 8-bit integer (0~255).

  • using u16 = std::uint16_t

    Unsigned 16-bit integer (0~65535).

  • using u32 = std::uint32_t

    Unsigned 32-bit integer (0~4294967295).

  • using u64 = std::uint64_t

    Unsigned 64-bit integer (0~18446744073709551615).

  • using i8 = std::int8_t

    Signed 8-bit integer (-128~127).

  • using i16 = std::int16_t

    Signed 16-bit integer (-32768~32767).

  • using i32 = std::int32_t

    Signed 32-bit integer (-2147482648~2147483647).

  • using i64 = std::int64_t

    Signed 64-bit integer (-9223372036854775808~9223372036854775807).

  • using f32 = float

    32-bit (single precision) floating point number.

  • using f64 = double

    64-bit (double precision) floating point number.

  • using byte_t = u8

    An alias of u8 that represents one byte. You may use this type to differentiate the concept of byte stream (byte_t) from number array (u8).

  • using nullptr_t = std::nullptr_t

    usize is the unsigned integer type of whose length marches the machine architecture. In particular, in 32-bit application, this is 32-bit unsigned integer; in 64-bit application, this is 64-bit unsigned integer. The usize type is guaranteed to be large enough to store a indexable memory address, so that any pointer can be reinterpreted casted to usize.

  • using opaque_t = void*

    opaque_t is used to represent one opaque pointer that shall not be reinterpreted or dereferred by the user. opaque_t are ususally used as arguments or returns values of interface functions to hide the implementation from the user.

  • using c8 = char

    8-bit character. Signed/unsigned is unspecified, cast this to u8/i8 for fetching number.

  • using c16 = char16_t

    16-bit character. Signed/unsigned is unspecified, cast this to u16/i16 for fetching number.

  • using c32 = char32_t

    32-bit character. Signed/unsigned is unspecified, cast this to u32/i32 for fetching number.

Constants