forked from mpusz/mp-units
fix: quantity's compound operators fixed to behave like ints do
This commit is contained in:
@@ -203,15 +203,17 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr quantity& operator*=(const rep& rhs)
|
||||
requires requires(rep a, const rep b) { { a *= b } -> std::same_as<rep&>; }
|
||||
template<typename Rep2>
|
||||
constexpr quantity& operator*=(const Rep2& rhs)
|
||||
requires requires(rep a, const Rep2 b) { { a *= b } -> std::same_as<rep&>; }
|
||||
{
|
||||
value_ *= rhs;
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr quantity& operator/=(const rep& rhs)
|
||||
requires requires(rep a, const rep b) { { a /= b } -> std::same_as<rep&>; }
|
||||
template<typename Rep2>
|
||||
constexpr quantity& operator/=(const Rep2& rhs)
|
||||
requires requires(rep a, const Rep2 b) { { a /= b } -> std::same_as<rep&>; }
|
||||
{
|
||||
value_ /= rhs;
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user