Boost logo

Boost Users :

From: Arno Schödl (aschoedl_at_[hidden])
Date: 2006-08-24 02:38:40


Hello,

I simply want to increment a macro, like that:

#define VARIABLE 7
FunctionA( VARIABLE ); // VARIABLE expands to 7
#define VARIABLE BOOST_PP_INC(VARIABLE)
FunctionB( VARIABLE ); // VARIABLE expands to 8
#define VARIABLE BOOST_PP_INC(VARIABLE)
FunctionC( VARIABLE ); // VARIABLE expands to 9
#define VARIABLE BOOST_PP_INC(VARIABLE)
...

Of course, as I have written it, it does not work. What's the right way?

Thanks a lot!

Arno

P.S. I don't want to iterate. FunctionA/B/C are all different constructs. I simply want to avoid forgetting to adjust all numbers when making a change to the chain of calls.


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