|
Boost : |
From: Richard Peters (r.a.peters_at_[hidden])
Date: 2004-05-14 04:41:26
----- Original Message -----
From: "Joel Young" <jdy_at_[hidden]>
>
> Feature Request:
>
> Can support for alternate numerics packages be specified in
> the type declaration for big_integer rather then with
> a macro? I'd like to be able to have multiple implementations
> declared in the same program.
>
> Joel
This can be done, but what is the reason to do use different types (besides
easier testing)? My idea was to make one portable integer type, which could
make use of the fastest library installed. That's why it uses macros to
select its implementation. If you create a program which explicitly uses gmp
or cln, then it's a nonportable program.
Interaction between integers based on alternate numerics packages would be
the most difficult. An obvious approach would be to use
convert_integer_to_little_endian and convert_little_endian_to_integer, but
it's not that efficient...
If it's for testing only, where no interaction is needed, then it's quite
easy. Macros would still be needed to really enable a library, because
otherwise the code does not compile on a platform that hasn't got the
library installed, but it is not too difficult to make the integer types
parameterized on an enum telling which implementation to pick.
Richard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk