Fix friend issues in mpq/mpz

This commit is contained in:
Soonho Kong 2013-07-19 09:34:58 -07:00 committed by Leonardo de Moura
parent a169837a3e
commit a376e478f8

View file

@ -18,8 +18,8 @@ class mpq {
static mpz_t & zval(mpz & v) { return v.m_val; }
public:
friend void swap(mpq & a, mpq & b) { mpq_swap(a.m_val, b.m_val); }
friend void swap_numerator(mpq & a, mpz & b) { mpz_swap(mpq_numref(a.m_val), b.m_val); mpq_canonicalize(a.m_val); }
friend void swap_denominator(mpq & a, mpz & b) { mpz_swap(mpq_denref(a.m_val), b.m_val); mpq_canonicalize(a.m_val); }
friend void swap_numerator(mpq & a, mpz & b) { mpz_swap(mpq_numref(a.m_val), zval(b)); mpq_canonicalize(a.m_val); }
friend void swap_denominator(mpq & a, mpz & b) { mpz_swap(mpq_denref(a.m_val), zval(b)); mpq_canonicalize(a.m_val); }
mpq & operator=(mpz const & v) { mpq_set_z(m_val, v.m_val); return *this; }
mpq & operator=(mpq const & v) { mpq_set(m_val, v.m_val); return *this; }