|
Boost : |
Subject: [boost] Re : Re : Re : [preprocessor] ifdef equivalent inside a macro, is it possible?
From: damien benoist (damien_benoist_at_[hidden])
Date: 2011-08-11 09:05:49
> Is it possible for you to make the macro defined to some special value
> rather than being undefined ?
Yes, but I have many cases like this.
This time it will look like this
(the ifdef DEFINE_FOO is not needed):
// my default values
#define FOO1 foo1
#define FOO2 foo2
...
#define FOO42 foo42
// optional overriding values
# define FOO1_OVERRIDE (BOOST_PP_NIL)
...
# define FOO23_OVERRIDE (BOOST_PP_NIL)
// The only macro I would like to have to write
# define FOO24_OVERRIDE (myFoo24, BOOST_PP_NIL)
# define FOO25_OVERRIDE (BOOST_PP_NIL)
...
# define FOO42_OVERRIDE (BOOST_PP_NIL)
And it turns out to be simpler to write:
#define FOO1_OVERRIDE FOO1
...
#define FOO23_OVERRIDE FOO23
#define FOO24_OVERRIDE myFoo24
#define FOO25_OVERRIDE FOO25
...
#define FOO42_OVERRIDE FOO42
Thanks for your help.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk