title: Searching for a string in an input stream
body: <p>I have a large binary file (many gigabytes, so loading it into memory is not an option) that I want to search for all occurrences of the string "icpf".</p>
  
  <p>I tried using <code>std::search</code> for this, but just got bitten by the fact that <code>std::search</code> only works for forward iterators, not input iterators.</p>
  
  <p>Does the standard library provide a fast alternative for this? Or do I need to hand-code the search (either reading in chunks at a time then <code>std::search</code> on those, or <code>ignore</code> everything until an 'i' and then manually check the next three characters)?</p>