[bigint] A patch for Bigint operators to provide consistent behavior

Alexander Shaduri <ashaduri at gmail.com>
Thu Feb 2 08:39:53 PST 2012


Hello,

First, I'd like to thank you for your excellent Big Integer library!

I had some trouble using the BigInteger type with some template
libraries, since the overloaded operators don't really behave like
the built-in ones (for int, for example). That is, they don't have the
correct return values - most of them return void.

I'm attaching a patch which makes the operators consistent
with the the ones of built-in types. For me, this patch fixed some
problems with generic template libraries which expect the operators
to be present and have built-in-like signatures. It also fixed a compiler
error of Visual Studio 2008 when using std::complex<BigInteger>.
Also, it allows the user to use BigInteger as a drop-in replacement
in statements like:
a = b = c = d;
a = ++b;
and such.
I hope you find this useful and merge it upstream.

Thanks,
Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bigint_operators.diff
Type: text/x-patch
Size: 11687 bytes
Desc: not available
URL: <http://mattmccutchen.net/mailman/archives/bigint/attachments/20120202/21483c71/attachment.bin>


More information about the bigint mailing list