title: redirected cout -> std::stringstream, not seeing EOL
body: <p>I've read a bunch of posts regarding redirecting std::cout to stringstreams, but I'm having problem reading the redirected string.</p>
  
  <pre><code>std::stringstream redirectStream;
  std::cout.rdbuf( redirectStream.rdbuf() );
  
  std::cout &lt;&lt; "Hello1\n";
  std::cout &lt;&lt; "Hello2\n";
  
  while(std::getline(redirectStream, str))
  {
    // This does not work - as the contents of redirectStream 
    // do not include the '\n' - I only see "Hello1Hello2"
  }
  </code></pre>
  
  <p>I need to pick out the new lines within the initial output - can anyone enlighten me as to how to do that?</p>
  
  <p>Thanks.</p>