What's wrong with:
#define since(x) if(assert(x), 1)
(assert is required to expand to a void expression.)
if (foo) handle_foo(); else if (bar) handle_bar(); else since (baz) handle_baz(); else since (quuz) handle_quux();
since
if
What's wrong with:
(assert is required to expand to a void expression.)
#ifdef NDEBUG
#define since(cond) if (0) ; else
#else
#define since(cond) if (!(cond)) { assert(0); } else
#endif
As a side note, since() plays merry hell with emacs's formatting…
sinceis anif.