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
I want to make sure that the project fails to compile if user forgot to define this string.
While i'd check this in a previous build-step, you can do this at compile-time. Using Boost for brevity:
#define A "a"
#define B
BOOST_STATIC_ASSERT(sizeof(BOOST_STRINGIZE(A)) > 1); // succeeds
BOOST_STATIC_ASSERT(sizeof(BOOST_STRINGIZE(B)) > 1); // fails