//: C07:StreamIt.cpp // From "Thinking in C++, Volume 2", by Bruce Eckel & Chuck Allison. // (c) 1995-2004 MindView, Inc. All Rights Reserved. // See source code use permissions stated in the file 'License.txt', // distributed with the code package available at www.MindView.net. // Iterators for istreams and ostreams. #include #include #include #include #include #include "../require.h" using namespace std; int main() { ifstream in("StreamIt.cpp"); assure(in, "StreamIt.cpp"); istream_iterator begin(in), end; ostream_iterator out(cout, "\n"); vector vs; copy(begin, end, back_inserter(vs)); copy(vs.begin(), vs.end(), out); *out++ = vs[0]; *out++ = "That's all, folks!"; } ///:~