22 Jul
2011
22 Jul
'11
10:07 a.m.
Den 22-07-2011 11:31, Nathan Ridge skrev:
This way one can write things like:
vector<T> v; push_back(v, istream_range<T>(ifstream("some_file.txt")));
Of course, one must be careful with such things.
Can you spot the bug in the following?
BOOST_FOREACH(const string& s, istream_range<string>(ifstream("some_file.txt"))) cout<< s;
Wouldn't that fail to compile if the istream_range is not copyable, but movable? -Thorsten