speed of mpz_odd_p and lazy allocation

Gabriel Dos Reis gdr at integrable-solutions.net
Tue Aug 21 22:56:47 CEST 2012


On Tue, Aug 21, 2012 at 3:33 PM, Marc Glisse <marc.glisse at inria.fr> wrote:

> Note that by default, C++11 assumes that destructors don't throw. If we want
> to allow users to throw from their deallocation functions (why?), we might
> want to specify it (which disables the optimization discussed here).

This is a library and you have a choice here to goad your users into doing
the right thing.  Throwing from a destructor is just very very very bad idea.
Don't complicate the library just to make that weirdness a possibility.  It is
not worth it.  Even if it is free, don't allow it.  It is just just
wrong design.

-- Gaby


More information about the gmp-devel mailing list