Hi,
I'm trying to initialize string with iterators and something like this works:
ifstream fin("tmp.txt");
istream_iterator<char> in_i(fin), eos; //here eos is 1 over the end
string s(in_i, eos);
but this doesn't:
ifstream fin("tmp.txt");
istream_iterator<char> in_i(fin), eos(fin);/* here eos is at this same position as in_i*/
//moving eos forward
for (int i = 0; i < 20; ++i)
{
++eos;
}
//trying to initialize string with pair of iterators gives me "" result
string s(in_i, eos);
Thank you.