dcclyde's blog

By dcclyde, history, 21 month(s) ago, In English

My C++ template, incl. fancy colorized debug printouts

Use this template and you'll gain 350 rating right away! OK maybe not, but it has a bunch of cool features I built up while climbing from 1800 to 2150 in February-May of this year, and I bet some of them can be helpful to others too. Please, comment with feedback/suggestions/feature requests about how to make the template more useful :)

Links

  • Current template.cpp — includes updates made after this blog was posted. This is the recommended version for most people.
  • Minimal version with debug printouts only — Stripped-down version that compiles faster while still providing the dbg() setup, which is IMO the most novel and cool feature in the template. Recommended if your computer is too slow to compile the main version. But please try the precompiled headers trick first, since that helps the compile times a lot!

Specific cool tricks in the template

Debug printouts

Here's an output screenshot:

...and here's the code I used

Full text and comments »

  • Vote: I like it
  • +68
  • Vote: I do not like it