|
Boost Users : |
Subject: Re: [Boost-users] PP: 2 to the power x macro
From: Ravi (lists_ravi_at_[hidden])
Date: 2010-02-04 15:57:02
On Thursday 04 February 2010 10:49:25 Hicham Mouline wrote:
> >// Must expand to "int foo8;", but it does not.
> >int BOOST_PP_CAT(foo, POWER2(3));
>
> Exactly.
> Ravi, the macro expansion does not evaluate the << operator, that is done
> at compile-time.
I see now. Roman's proposed solution is the right one. If you look at any of
the headers inside boost/preprocessor/arithmetic/, your solution (for the
usual operators) and Roman's solution (for inc and dec) are really the only
ones that are used.
Regards,
Ravi
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net