summaryrefslogtreecommitdiff
path: root/gmpxx.h
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2011-05-06 23:31:07 +0200
committerMarc Glisse <marc.glisse@inria.fr>2011-05-06 23:31:07 +0200
commit8e28b13a11b763fe57d2890833bc3e534a0e30c4 (patch)
tree340cc8e15c9247440f8da36ee7dd8acbd3d35b8b /gmpxx.h
parent80aa8191296bb40a8a35e03db6c6d2eae329cb52 (diff)
downloadgmp-8e28b13a11b763fe57d2890833bc3e534a0e30c4.tar.gz
Make some conversions between C++ types explicit.
Diffstat (limited to 'gmpxx.h')
-rw-r--r--gmpxx.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/gmpxx.h b/gmpxx.h
index 1aff6c2c9..a6b8140a7 100644
--- a/gmpxx.h
+++ b/gmpxx.h
@@ -1288,8 +1288,11 @@ public:
__gmp_expr() { mpz_init(mp); }
__gmp_expr(const __gmp_expr &z) { mpz_init_set(mp, z.mp); }
+ template <class T>
+ __gmp_expr(const __gmp_expr<mpz_t, T> &expr)
+ { mpz_init(mp); __gmp_set_expr(mp, expr); }
template <class T, class U>
- __gmp_expr(const __gmp_expr<T, U> &expr)
+ explicit __gmp_expr(const __gmp_expr<T, U> &expr)
{ mpz_init(mp); __gmp_set_expr(mp, expr); }
__gmp_expr(signed char c) { mpz_init_set_si(mp, c); }
@@ -1456,8 +1459,14 @@ public:
__gmp_expr() { mpq_init(mp); }
__gmp_expr(const __gmp_expr &q) { mpq_init(mp); mpq_set(mp, q.mp); }
+ template <class T>
+ __gmp_expr(const __gmp_expr<mpz_t, T> &expr)
+ { mpq_init(mp); __gmp_set_expr(mp, expr); }
+ template <class T>
+ __gmp_expr(const __gmp_expr<mpq_t, T> &expr)
+ { mpq_init(mp); __gmp_set_expr(mp, expr); }
template <class T, class U>
- __gmp_expr(const __gmp_expr<T, U> &expr)
+ explicit __gmp_expr(const __gmp_expr<T, U> &expr)
{ mpq_init(mp); __gmp_set_expr(mp, expr); }
__gmp_expr(signed char c) { mpq_init(mp); mpq_set_si(mp, c, 1); }