Merge branch 'master' of github.com:mpusz/units

This commit is contained in:
Mateusz Pusz
2021-02-15 18:34:41 +01:00
2 changed files with 22 additions and 0 deletions
+14
View File
@@ -210,6 +210,13 @@ public:
value_ *= rhs;
return *this;
}
template<typename Rep2>
constexpr quantity& operator*=(const dimensionless<units::one, Rep2>& rhs)
requires requires(rep a, const Rep2 b) { { a *= b } -> std::same_as<rep&>; }
{
value_ *= rhs.count();
return *this;
}
template<typename Rep2>
constexpr quantity& operator/=(const Rep2& rhs)
@@ -218,6 +225,13 @@ public:
value_ /= rhs;
return *this;
}
template<typename Rep2>
constexpr quantity& operator/=(const dimensionless<units::one, Rep2>& rhs)
requires requires(rep a, const Rep2 b) { { a /= b } -> std::same_as<rep&>; }
{
value_ /= rhs.count();
return *this;
}
constexpr quantity& operator%=(const rep& rhs)
requires (!floating_point_<rep>) &&