13
0

temporal: add operator== and operator!= for ratio_t

This commit is contained in:
Paul Davis 2022-05-31 12:32:34 -06:00
parent 43f58f88a6
commit 2d24bcdf4a

View File

@ -78,6 +78,14 @@ class _ratio_t {
double to_double() const { return (double) _numerator / _denominator; };
bool operator== (_ratio_t<T> const & other) const {
return _numerator == other._numerator && _denominator == other._denominator;
}
bool operator!= (_ratio_t<T> const & other) const {
return _numerator != other._numerator || _denominator != other._denominator;
}
private:
T _numerator;
T _denominator;