Skip to content

Instantly share code, notes, and snippets.

@kodo-pp
Created January 13, 2019 13:18
Show Gist options
  • Save kodo-pp/1d83ea80e092317849276a006ee95edf to your computer and use it in GitHub Desktop.
Save kodo-pp/1d83ea80e092317849276a006ee95edf to your computer and use it in GitHub Desktop.
Some macros for debugging (olympiad programming)
#ifdef AAA
#define db(x) \
std::cerr << "\x1b[1;35m[DEBUG] " << __LINE__ << "\t|\x1b[0;34m " \
#x "\x1b[0m = \x1b[32m" << (x) << "\x1b[0m" << std::endl
#define dbx(x) \
std::cerr << "\x1b[1;35m[DEBUG] " << __LINE__ << "\t| \x1b[0;34m " \
#x "\x1b[0m = \x1b[32m" << (x) << "\x1b[0m" << std::endl
#define dbs(s) \
std::cerr << "\x1b[1;35m[DEBUG] " << __LINE__ << "\t| \x1b[0;34m " \
<< s << "\x1b[0m" << std::endl
#define dbsx(s) \
std::cerr << "\x1b[1;35m[DEBUG] " << __LINE__ << "\t| \x1b[0;34m " \
<< s << "\x1b[0m" << std::endl
#else
#define db(x)
#define dbx(x)
#define dbs(s)
#define dbsx(s)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment