|
Boost : |
From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-03-24 14:07:04
Andras Erdei wrote:
> what would you say to this:
>
>
> namespace rational
> {
>
> template < class unlimited >
> class unlimited
> {
> //...
> } ;
>
> enum policy
> {
> round ,
> round_and_exactness ,
> exception ,
> assert
> } ;
>
> // for power users
> template < typename limited , policy rounding = round >
> class fxs_
> {
> //...
> } ;
>
> typedef __int64 biggest_builtin ;
>
> // for end-users
> template < biggest_builtin limit = INT_MAX , policy rounding =
> round > class fxs
> : public fxs_< fastest type that can hold [-limit...limit] ,
> rounding > {
> //...
> } ;
>
> // if you are really desperate and want to specify by hand
> // the num_type, den_type, num_min, num_max, den_min, den_max etc
> // there is a way to create your own policy blob
>
> // of course we need better names than fxs and fxs_
>
> }
Do I understand correctly that rational::unlimited would be like the current
rational, while rational::fxs would provide a separate interface for rationals
based on built-in integral types?
Would there be any shared implementation?
Is fxs for power-users too, or just fxs_?
I agree that a better name than "fxs" is needed. Could you give me a hint what
it means? ;-)
Jonathan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk