Choosing between mpf_class and double at compile time

Christopher Creutzig ccr at
Fri Feb 27 08:56:23 CET 2009

Pasquale Tricarico wrote:

> But this would severely degrade the code. So I was wondering if anyone
> here on the list has a good solution to switch between mpf_class and
> double the smart way, staying away from evil macros. Thanks a lot.

 Templates, obviously. For the conversion operators (including
printing), especially have a look at boost's lexical_cast operator and
specialize and/or overload that.


More information about the gmp-discuss mailing list