diff --git a/src/util/mpq.h b/src/util/mpq.h index 90a01530b..5fd4b227d 100644 --- a/src/util/mpq.h +++ b/src/util/mpq.h @@ -30,8 +30,8 @@ public: mpq(int v):m_num(v), m_den(1) {} mpq():m_den(1) {} mpq(mpq &&) noexcept = default; - mpq & operator=(mpq const &) = delete; - mpq & operator=(mpq&&) = delete; + mpq & operator=(mpq const &) noexcept = default; + mpq & operator=(mpq&&) noexcept = default; void swap(mpq & other) { m_num.swap(other.m_num); m_den.swap(other.m_den); } mpz const & numerator() const { return m_num; } mpz const & denominator() const { return m_den; } diff --git a/src/util/rational.h b/src/util/rational.h index cd627d27f..617c2fadc 100644 --- a/src/util/rational.h +++ b/src/util/rational.h @@ -132,7 +132,7 @@ public: rational const & get_infinitesimal() const { return m_zero; } - rational & operator=(rational&&) = default; + rational & operator=(rational&&) noexcept = default; rational & operator=(rational const & r) { m().set(m_val, r.m_val); @@ -149,7 +149,7 @@ private: public: rational & operator=(int v) { - *this = rational(v); + m().set(m_val, v); return *this; } rational & operator=(double v) { UNREACHABLE(); return *this; }