test: test for lack of consitency between op+ and op+= for quantity_point

This commit is contained in:
Mateusz Pusz
2024-11-04 09:41:11 +01:00
parent 5810420277
commit f461cf479b

View File

@@ -483,6 +483,12 @@ static_assert((std::uint8_t{255}* m %= 257 * m).numerical_value_in(m) == [] {
return ui %= 257;
}());
// lack of consistency with binary operator
static_assert(
is_of_type<1 * (isq::length / isq::time)[m / s] + 1 * isq::speed[m / s], quantity<isq::speed[m / s], int>>);
static_assert(is_of_type<(1 * (isq::length / isq::time)[m / s] += 1 * isq::speed[m / s]),
quantity<(isq::length / isq::time)[m / s], int>>);
template<template<auto, typename> typename Q>
concept invalid_compound_assignments = requires() {
// truncating not allowed