Boost preprocessor library
Apr 29, 2013 at 8:47pm UTC
I'm having some trouble expanding to the base value
1 2 3 4 5 6 7 8 9
# include <boost/preprocessor/cat.hpp>
#define REL_ITERATION_1 1
#define REL_FRAME_ITERATION(i) BOOST_PP_CAT(REL_ITERATION_, i)
#define REL_ITERATION_PARAMS_2 REL_FRAME_ITERATION(1)
#define REL_FRAME1(i) BOOST_PP_CAT(REL_ITERATION_PARAMS_, i)
#define REL_FRAME2(i) REL_ITERATION_PARAMS_##i
REL_FRAME1(2)
REL_FRAME2(2)
Here's the output.
BOOST_PP_CAT(REL_ITERATION_, 1)
1
Does anyone have any idea why the first call is not the same as the second? I thought I had a handle on using the preprocessor, but I just don't get this. :(
Apr 29, 2013 at 9:03pm UTC
Never mind. I missed the part in the documentation where it says if it expands to a BOOST_PP_CAT() macro, it won't expand it.
Doh!
Topic archived. No new replies allowed.