title: DEBUG macros in C++
body: <p>I just encountered a DEBUG macro in C that I really like</p>
  
  <pre><code>#ifdef DEBUG_BUILD
  #  define DEBUG(x) fprintf(stderr, x)
  #else
  #  define DEBUG(x) do {} while (0)
  #endif
  </code></pre>
  
  <p>I'm guessing a C++ analogue would be :-</p>
  
  <pre><code>#ifdef DEBUG_BUILD
  #  define DEBUG(x) cerr &lt;&lt; x
  #else
  #  define DEBUG(x) do {} while (0)
  #endif
  </code></pre>
  
  <ol>
  <li>Is the second code snippet analogous to the one in C?</li>
  <li>Do you have any favorite C++ debug macros?</li>
  </ol>
  
  <p>EDIT : 
  By "Debug Macros" I mean "macros that might come in handy while running a program in debug mode".</p>