title: Standard no-op output stream
body: <p>Is there a way to create an ostream instance which basically doesn't do anything ?</p>
  
  <p>For example :</p>
  
  <pre><code>std::ostream dummyStream(...);
  dummyStream &lt;&lt; "Nothing will be printed";
  </code></pre>
  
  <p>I could just create an ostringstream, but data will be buffered (and I really don't want to make anything with them, so it adds a useless overhead).</p>
  
  <p>Any idea ?</p>
  
  <p><strong>[edit]</strong> Found this <a href="https://stackoverflow.com/questions/8243743/is-there-a-null-stdostream-implementation-in-c-or-libraries">related question</a> which suits my needs. However, I think it could be useful to have a answer saying how to create a <em>valid</em> (no badbit) output stream with standard c++.</p>