forked from mpusz/mp-units
operator% constrained to integral types only (resolves #16)
This commit is contained in:
@@ -242,13 +242,16 @@ namespace units {
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr quantity& operator%=(const rep& rhs)
|
||||
template<Scalar Rep2>
|
||||
constexpr quantity& operator%=(const Rep2& rhs)
|
||||
requires (!treat_as_floating_point<rep> && !treat_as_floating_point<Rep2>)
|
||||
{
|
||||
value_ %= rhs;
|
||||
return *this;
|
||||
}
|
||||
|
||||
constexpr quantity& operator%=(const quantity& q)
|
||||
requires (!treat_as_floating_point<rep>)
|
||||
{
|
||||
value_ %= q.count();
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user