fix: lack of compound assignment from dimensionless<one>

This commit is contained in:
Johel Ernesto Guerrero Peña authored and Mateusz Pusz committed 2021-02-15 17:07:55 +01:00
1 parent 8f04bd9cfe
commit a168f49b66
2 files changed
+22

No files matched your search

+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>) &&