How do I implement no-op macro in C++?
#include
#ifdef NOOP
#define conditional_noop(x) what goes here?
#else
#
As mentioned before - nothing.
Also, there is a misprint in your code.
it should be #else not #elif. if it is #elif it is to be followed by the new condition
#include
#ifdef NOOP
#define conditional_noop(x) do {} while(0)
#else
#define conditional_noop(x) std::cout << (x)
#endif
Have fun coding! EDIT: added the [do] construct for robustness as suggested in another answer.