
4 Feb
2010
4 Feb
'10
2:26 a.m.
2010/2/4 Ravi <lists_ravi@lavabit.com>
On Tuesday 02 February 2010 21:29:40 Hicham Mouline wrote:
I can't find this left shift operator in Boost.PP. Do you mean << ? But then how do I evaluate it in the context of the preprocessor?
Unless I have misunderstood your question (very likely), isn't this what you need?
#define POWER2(a) (1<<a) // Example usage in the context of the preprocessor #if POWER2(3) == 8 #error "Success, correct calculation" #else #error "Failure" #endif
How about this? // Must expand to "int foo8;", but it does not. int BOOST_PP_CAT(foo, POWER2(3)); Roman Perepelitsa.