|
Boost : |
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2005-09-02 19:42:59
> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Matt Calabrese
> > I expect these binary literals to
> > work any place that an integer literal would work at compile (not
> > preprocessing) time.
>
>
> Forgive me if this has already been addressed, but is there a
> reason as to why a template is prefered here as opposed to a
> macro solution? A solution using preprocessor metaprogramming
> would allow one to use the value at preprocessing time as
> well as compile-time, making a template version unecessary,
> and syntactically it would be even simpler since you wouldn't
> need to do ::value. The call could be as simple as BOOST_BINARY_INT(
> (1100)(0011)(1010) ) using Boost.Preprocessor sequences.
> Again, I am sorry if this has already been addressed.
The problem is that there isn't any arbitrary precision arithmetic support in
the pp-lib. If there was, you could do better than that for syntax:
BOOST_BINARY_INT( 1100 0011 1010 )
Regards,
Paul Mensonides
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk