14namespace stratax::core::validation {
37template<Numeric L, Numeric R>
47 using expression_type =
decltype(lhs / rhs);
48 if constexpr (std::is_signed_v<expression_type>)
50 if (
static_cast<expression_type
>(lhs) ==
51 std::numeric_limits<expression_type>::min() &&
52 static_cast<expression_type
>(rhs) == expression_type{-1})
71template<
typename Value, Integral Count>
74 if constexpr (std::is_signed_v<std::remove_cvref_t<Count>>)
82 using value_type = std::remove_cvref_t<Value>;
84 return static_cast<std::uintmax_t
>(count) <
85 sizeof(value_type) * CHAR_BIT;
96template<
typename Value, Integral Count>
99 if (!valid_shift_count<Value>(count))
Dtype and array interface concepts.
Stratax exception types derived from std::runtime_error.
void require_valid_division(const L &lhs, const R &rhs)
Rejects zero divisors and unrepresentable native signed division.
void require_valid_shift_count(const Count &count)
Rejects shift counts outside the stored value type's bit width.
constexpr bool valid_shift_count(const Count &count) noexcept
Tests whether a shift count is valid for a value type.
Explicitly detected numeric overflow, including signed division minimum by minus one; other arithmeti...
Invalid argument value, such as an invalid shift count or null nonempty view.
An explicitly checked divisor is zero.
Supported integer dtype, excluding bool.