diff --git a/src/include/units/quantity.h b/src/include/units/quantity.h index b7c901ce..b38c1ed9 100644 --- a/src/include/units/quantity.h +++ b/src/include/units/quantity.h @@ -53,13 +53,21 @@ namespace units { // UnitRep template concept UnitRep = Scalar && - (treat_as_floating_point == false || + // integral + ((treat_as_floating_point == false && + requires(T a, T b) { + { a % b } -> T; + { a++ } -> T; + { ++a } -> T&; + { a-- } -> T; + { --a } -> T&; + }) || + // floating-point requires(T&& a) { - { ::units::isfinite(std::forward(a)) } -> bool; - { ::units::isnan(std::forward(a)) } -> bool; + ::units::isfinite(std::forward(a)); + ::units::isnan(std::forward(a)); }); - template class quantity;