Anyone aware of the following problem with the gnu compiler (or just the mingw port) ??
The following simple code does not compile :
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<int> coll;
coll.push_back(10);
coll.push_back(20);
coll.push_back(30);
copy(coll.begin(), coll.end(), ostream_iterator<int>(cout, "\n"));
return 0;
} // end of main
I get :
main.cpp: In function `int main()':
main.cpp:13: error: `ostream_iterator' undeclared (first use this function)
main.cpp:13: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:13: error: expected primary-expression before "int"
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings
I does build with M$ VC 2005, and according tothe book The C++ Standard Library (Josuttis), page 107, this is correct code.
IS there some part not supported by either :
- GNU C++ compiler
- MingW port
kind regards,
Lieven