title: Constructing a vector with istream_iterators
body: <p>I recall once seeing a clever way of using iterators to read an entire binary file into a vector.  It looked something like this:</p>
  
  <pre><code>#include &lt;fstream&gt;
  #include &lt;ios&gt;
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  int main() {
      ifstream source("myfile.dat", ios::in | ios::binary);
      vector&lt;char&gt; data(istream_iterator(source), ???);
      // do stuff with data
      return 0;
  }
  </code></pre>
  
  <p>The idea is to use <code>vector</code>'s iterator range constructor by passing input iterators that specify the entire stream.  The problem is I'm not sure what to pass for the end iterator.  </p>
  
  <p>How do you create an <code>istream_iterator</code> for the end of a file?  Am I completely misremembering this idiom?</p>