Fix friend issues in mpq/mpz
This commit is contained in:
parent
a169837a3e
commit
a376e478f8
1 changed files with 55 additions and 55 deletions
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue