From f461cf479b959df8590b8f54119398d33c9c9491 Mon Sep 17 00:00:00 2001 From: Mateusz Pusz Date: Mon, 4 Nov 2024 09:41:11 +0100 Subject: [PATCH] test: test for lack of consitency between `op+` and `op+=` for `quantity_point` --- test/static/quantity_test.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/static/quantity_test.cpp b/test/static/quantity_test.cpp index 8210542a..e175f25c 100644 --- a/test/static/quantity_test.cpp +++ b/test/static/quantity_test.cpp @@ -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>); +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 typename Q> concept invalid_compound_assignments = requires() { // truncating not allowed