Skip to main content

ClikaRT::dtype::int2_t

struct

Header: ClikaRT/compute/scalar_types.h

Signed 2-bit integer, range [-2, 1]. Low 2 bits of a byte.

Static member functions​

from_bits()​

static constexpr int2_t from_bits(std::uint8_t b) noexcept

Reinterpret the low 2 bits of b without conversion.

Declared in ClikaRT/compute/scalar_types.h, line 437

Member functions​

int2_t()​

constexpr constexpr int2_t() noexcept=default

Declared in ClikaRT/compute/scalar_types.h, line 434

int2_t(int8_t)​

constexpr explicit constexpr int2_t(std::int8_t v) noexcept

Wrap an 8-bit value: keeps the low 2 bits (wraps; no saturation or range check).

Declared in ClikaRT/compute/scalar_types.h, line 435

operator std::int8_t()​

constexpr constexpr operator std::int8_t() const noexcept

Declared in ClikaRT/compute/scalar_types.h, line 436

Data members​

bits​

std::uint8_t bits = 0

Raw encoding in the low 2 bits (the storage/ABI form).

Declared in ClikaRT/compute/scalar_types.h, line 433

Friends​

operator==​

friend bool operator==(int2_t a, int2_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 438

operator!=​

friend bool operator!=(int2_t a, int2_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 439

operator<​

friend bool operator<(int2_t a, int2_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 440

operator<=​

friend bool operator<=(int2_t a, int2_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 441

operator>​

friend bool operator>(int2_t a, int2_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 442

operator>=​

friend bool operator>=(int2_t a, int2_t b) noexcept

Compares a and b by widened integer value.

Declared in ClikaRT/compute/scalar_types.h, line 443