This must be a problem with my crappy Visual C++ 6.0 compiler, but I thought I'd check if I'm doing something wrong...
The code below is almost identical to Item 6 of "Effective STL" (I'm just using a string instead of list), but it gives me a C2664 error on the last line.
If it's a compiler problem, does anyone know a workaround in VC++ 6.0?
The code below is almost identical to Item 6 of "Effective STL" (I'm just using a string instead of list), but it gives me a C2664 error on the last line.
If it's a compiler problem, does anyone know a workaround in VC++ 6.0?
Code:
ifstream input( "file.txt" );
if ( !input )
{
cout << "Error opening file!" << endl;
return 1;
}
istream_iterator<char> start( input );
istream_iterator<char> end;
string strErr( start, end ); // error C2664!