|
Boost : |
From: Guillaume Melquiond (guillaume.melquiond_at_[hidden])
Date: 2003-10-28 11:23:53
Hi,
I find the C++ version of GMP to be a bit bloated. So I searched another
'big integer' library. I gave a try to the bigint library in the
sandbox. I used the GMP version of the library since its implementation
was rather trivial.
However I needed to apply this patch for it to work:
--- bigint_gmp.hpp.old 2003-10-28 17:06:07.000000000 +0100
+++ bigint_gmp.hpp.new 2003-10-28 17:07:15.000000000 +0100
@@ -107,6 +107,7 @@
if (&other != this) {
mpz_init_set(gmp_value_,other.gmp_value_);
}
+ return *this;
}
~bigint() {
@@ -179,7 +180,7 @@
}
};
-
+inline
void swap(bigint& lhs, bigint& rhs) {
lhs.swap(rhs);
}
I also needed to add a 'data' member in order to get a reference on the
underlying GMP datatype. The GMP library is indeed a lot more powerful
than the small subset present in the bigint library. May I suggest its
addition?
Regards,
Guillaume
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk