Using C++ preprocessor directives, is it possible to test if a preprocessor symbol has been defined but has no value? Something like that:
#define MYVARIABLE
You can use the BOOST_PP_IS_EMPTY
macro like so:
#include
#define MYVARIABLE
#if !defined(MYVARIABLE) || !BOOST_PP_IS_EMPTY(MYVARIABLE)
// ... blablabla ...
#endif
That did the trick for me. I shall add this macro is undocumented, so use it with caution.
Source: preprocessor-missing-IS-EMPTY-documentation