
22 Oct
2004
22 Oct
'04
5:12 p.m.
"Peter Dimov" <pdimov@mmltd.net> writes:
David Abrahams wrote:
Is this going to be illegal for most fs, then? std::copy( std::istream_iterator<char>(f), std::istream_iterator<char>(), std::back_inserter(my_utf8_string)); I think it pretty much has to work.
my_utf8_string.append( std::istream_iterator<char>(f), std::istream_iterator<char>() );
is the proper spelling. Or, if you prefer,
my_utf8_string.insert( my_utf8_string.end(), std::istream_iterator<char>(f), std::istream_iterator<char>() );
Character by character push_back loops just aren't cool.
Okay, but should we make this well-known and understood idiom one that compiles and fails at runtime? -- Dave Abrahams Boost Consulting http://www.boost-consulting.com