#ifndef UTILS__SHOW_H #define UTILS__SHOW_H #ifndef SHOWS #include #define SHOWS std::cerr #endif /* usage: #if DEBUG # define IFD(x) x #else # define IFD(x) #endif SHOWS(IFD,x) SHOWS(IFD,y) SHOW(IFD,nl_after) will print x=X y=Y nl_after=NL_AFTER\n if DEBUG. SHOW3(IFD,x,y,nl_after) is short for the same SHOWP("a") will just print "a" careful: none of this is wrapped in a block. so you can't use one of these macros as a single-line block. */ #define SHOWP(IF,x) IF(SHOWS<