title: c++ How to save the use of a temporary variable
body: <p>I have the following code in C++:</p>
  
  <pre><code>string str="a b c";
  stringstream sstr(str);
  vector&lt;string&gt; my_vec((istream_iterator&lt;string&gt;(sstr)), 
                         istream_iterator&lt;string&gt;());
  </code></pre>
  
  <p>Is there any way to save the use of <code>sstr</code>, something like the following?</p>
  
  <pre><code>vector&lt;string&gt; my_vec((istream_iterator&lt;string&gt;(str)), 
                         istream_iterator&lt;string&gt;());
  </code></pre>