title: strange behaviour of this c++ piece of code (std::wcout and std::exception)
body: <p>I'm working with this piece of code and I've found that the method doesn't throw the exception after a succesfull call. If I use std::cout all is fine and the exception is thrown. I'm using gcc version 4.9.2 (Debian 4.9.2-10). Is it a gcc bug or stl bug a code problem or what else? </p>
  
  <pre><code>// exceptions
  #include &lt;iostream&gt;
  using namespace std;
  class C {
     public:
      string srch(int &amp;i) {
          if (i == 0) {   //found
              wcout &lt;&lt; "got it: " &lt;&lt; i &lt;&lt; endl; return "i";
          }
         throw std::exception();
  
      }
  
   };
  
   int main () {
     C c = C();
     int i = 2;
     int j = 0;
     try
     {
       c.srch(j);
       c.srch(i);
     }
     catch (const std::exception &amp;e) {
       cout &lt;&lt; "An exception occurred. Exception Nr. " &lt;&lt; e.what() &lt;&lt; '\n';
     }
      return 0;
   }
  </code></pre>
  
  <p>Here's an <a href="http://ideone.com/s6fkXj" rel="nofollow noreferrer">ideone link to reproduce the lack of an exception with <code>wcout</code>.</a> and <a href="http://ideone.com/TIgo4C" rel="nofollow noreferrer">a link reproducing the exception when <code>cout</code> is used</a>.</p>