title: C++ enable/disable debug messages of std::couts on the fly
body: <p>Is there a way to define/undefine debug messages using std::cout whenever inside a program?</p>
  
  <p>I am aware that there are such things such as #define, #ifndef, but I was thinking is there a cleaner way to having a variable say:</p>
  
  <pre><code># debug ON
  </code></pre>
  
  <p>That prints all of my debug data (using std::cout).  Consequently, we'll have code like this for debug:</p>
  
  <pre><code>#ifndef DEBUG
  // do something useful
  #endif
  </code></pre>
  
  <p>I find the above code cumbersome when you write 100s of debug code.</p>
  
  <p>Thanks!</p>
  
  <p>Carlo</p>