Skip to content

Commit

Permalink
test: test for lack of consitency between op+ and op+= for `quant…
Browse files Browse the repository at this point in the history
…ity_point`
  • Loading branch information
mpusz committed Nov 4, 2024
1 parent 5810420 commit f461cf4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/static/quantity_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f461cf4

Please sign in to comment.