Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2005-12-07 18:02:16


Hartmut Kaiser wrote:
> Joel de Guzman wrote:
>
>
>>I suggest an integer<N> class that uses built-ins when
>>it's detected that the compiler/platform supports N bits
>>and switch to an emulated fixed precision integer of N
>>bits when it is not available as a built-in. I also
>>suggest that such a class would be generally useful
>>in boost.
>
>
> I agree with you on that it would be generally useful for Boost and that it
> should fall back to the intrinsic types whenever possible. But wouldn't such
> a thing restrict Wave to one precision only (in the end N will be a compile
> time constant). What I really would like to see is something runtime
> configurable. Or do you had in mind an integer<N>, where N is some possible
> maximum defined at compile time?

Compile time or even runtime (if you have a couple of integer<N>
around). It's just like having an int16, int32, int64, around.
Only in this case, you are not tied to the limitations of the
platform and you are guaranteed to have the the exact precision
that you need.

Cheers,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk