|
Boost Users : |
Subject: [Boost-users] [boost-users] converting InputIterator to ForwardIterator
From: Igor R (boost.lists_at_[hidden])
Date: 2009-03-11 12:45:34
Hello,
I'd like to do the subj, in order to be able to apply some std
algorithms to files, like this:
ifstream file("myfile", std::ios::binary|std::ios::in);
std::string delim("\r\n\r\n"); // sequence to search
typedef std::istreambuf_iterator<char> iterator;
iterator begin(file), end;
iterator pos = std::find_end(begin, end, delim.begin(), delim.end());
// won't work, because istreambuf_iterator is *not* ForwardIterator
I found something called multi_pass in boost::spirit. However, I'm not
sure if it's relevant or deprecated class (it seems to be a part of
the "old" Spirit), and whether this's the only Boost utility I can use
to perform the above conversion.
Thanks.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net