title: Debug-only ostreams in C++?
body: <p>I've implemented an <code>ostream</code> for debug output which sends ends up sending the debug info to <code>OutputDebugString</code>. A typical use of it looks like this (where <code>debug</code> is an ostream object):</p>
  
  <pre><code>debug &lt;&lt; "some error\n";
  </code></pre>
  
  <p>For release builds, what's the least painful and most performant way to not output these debug statements? </p>