Hello,
I was trying out the new multiprecision library (kudos!), and I ran into a problem. In order to make certain guarantees in my code regarding exception safety, I am mandating that types being used in generic containers are marked noexcept() for certain basic operations (namely, destruction and move operations).
It seems like this is generally guaranteed in the multiprecision library (tried with cpp_int and the mpfr adaptor), with the important exception of the gmp integer class. A glance at the headers reveals that (gmp.hpp):
//
// Within this file, the only functions we mark as noexcept are those that manipulate
// (but don't create) an mpf_t. All other types may allocate at pretty much any time
// via a user-supplied allocator, and therefore throw.
//
There's currently no defined way for the allocation functions to recover from an error such as out of memory, they must terminate program execution. A longjmp or throwing a C++ exception will have undefined results. This may change in the future.