title: std::getline alternative when input line endings are mixed
body: <p>I'm trying to read in lines from a <code>std::istream</code> but the input may contain <code>'\r'</code> <strong>and/or</strong> <code>'\n'</code>, so <code>std::getline</code> is no use.</p>
  <p>Sorry to shout but this seems to need emphasis...</p>
  <h2>The input may contain <em>either</em> newline type <em>or both</em>.</h2>
  <p>Is there a standard way to do this? At the moment I'm trying</p>
  <pre><code>char c;
  while (in &gt;&gt; c &amp;&amp; '\n' != c &amp;&amp; '\r' != c)
      out .push_back (c);
  </code></pre>
  <p>...but this skips over whitespace. D'oh! <code>std::noskipws</code> -- <em>more</em> fiddling required and now it's misehaving.</p>
  <p>Surely there must be a better way?!?</p>