title: std::stringstream hex conversion error
body: <p>I tried to do hex conversions using <code>std::stringstream</code> as the following:</p>
  
  <pre><code>std::stringstream s;
  s &lt;&lt; std::hex;
  
  int i;
  
  s &lt;&lt; "100";
  s &gt;&gt; i;     // 256
  
  s &lt;&lt; "10";  // doesn't work
  s &gt;&gt; i;
  </code></pre>
  
  <p>But it fails on subsequent conversions as the comment points out. Do I need to reset the <code>stringstream</code>? Why does it fail?</p>