
15 Jul
2004
15 Jul
'04
3:17 a.m.
<Yossi.Itzkovich@ecitele.com> wrote
BOOST_PP_REPEAT works great for me when used like:
#define MAX 5 #define CODE my_code_goes_here BOOST_PP_REPEAT(MAX, CODE, )
But it gets confused when used like:
#define MAX (4+1)
Is ther a work around ?
#define MAX BOOST_PP_INC(4) or #define MAX BOOST_PP_ADD(4, 1)
I even tried: #define MAX (4+1) const int myMax=MAX; BOOST_PP_REPEAT(myMax, CODE , )
myMax is a compile-time constant which is not available to the preprocessor, that's why it doesn't work. HTH, Arkadiy