Boost logo

Boost Users :

Subject: [Boost-users] [preprocessor] different macro expansion depending on whether its argument is defined or not?
From: Ingolf Steinbach (ingolf.steinbach_at_[hidden])
Date: 2009-10-16 06:36:17


Hi,

is it possible to write a preprocessor macro which takes one argument
and which expands differently depending on whether the argument is
defined or not? Boost solution preferred.

Example:

#define FOO
#undef BAR

MY_MACRO(FOO) expands to 1
MY_MACRO(BAR) expands to 0

Kind regards
Ingolf


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