title: Reading an std::ifstream to a vector of lines
body: <p>How would I go about reading in a file where each line is a single number, then outputing that number into a vector of lines?</p>
  
  <p>eg: file.txt contains:</p>
  
  <pre><code>314
  159
  265
  123
  456
  </code></pre>
  
  <p>I have tried this implementation:</p>
  
  <pre><code>vector&lt;int&gt; ifstream_lines(ifstream&amp; fs) {
      vector&lt;int&gt; out;
      int temp;
      getline(fs,temp);
      while (!fs.eof()) {
          out.push_back(temp);
          getline(fs,temp);
      }
      fs.seekg(0,ios::beg);
      fs.clear();
      return out;
  }
  </code></pre>
  
  <p>but when I attempt to compile, I get errors such as:</p>
  
  <pre><code>error C2784: 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;std::getline
  (std::basic_istream&lt;_Elem,_Traits&gt; &amp;,std::basic_string&lt;_Elem,_Traits,_Alloc&gt; &amp;)' : 
  could not deduce template argument for 'std::basic_istream&lt;_Elem,_Traits&gt; &amp;' from 'std::ifstream'
  </code></pre>
  
  <p>so, obviously, something is wrong. Is there a more elegant solution than what I am trying? (Assuming 3rd party libraries like Boost are unavailable)</p>
  
  <p>Thanks!</p>