title: Reading from an iostream
body: <p>Maybe I'm missing something, but I'm having a lot of trouble finding any information on how to how to read from an iostream <code>(std::iostream&amp; stream)</code>. Is there a way I can convert it to a string or similar?</p>
  <p>For clarification this is (what I'm basically trying to do, for example):</p>
  <pre><code>std::stringstream ss(&quot;Maybe I'm missing something \n but I'm having a lot of trouble finding any information on how to how to read from an iostream.&quot;);
  readStream(ss);
  
  void readStream(std::iostream&amp; stream)
  {
      std::string out;
      stream &gt;&gt; out;
      // Do some stuff with the string
  }
  </code></pre>
  <p>This seems to work, but <code>out</code> will be equal to &quot;Maybe&quot; rather than the full string.</p>