This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
#include <iterator> (was Re: `ostream_iterator' undeclared in namespace `std'?)
- To: gcc-bugs at gcc dot gnu dot org
- Subject: #include <iterator> (was Re: `ostream_iterator' undeclared in namespace `std'?)
- From: Markus Werle <markus at lufmech dot rwth-aachen dot de>
- Date: Mon, 23 Jul 2001 17:38:25 +0200
- References: <3B5C263D.41EC388A@lufmech.rwth-aachen.de>
Markus Werle wrote:
> Today's cvs g++ tells me this fact.
> That was new to me. What do You think?
Well, I think, migrating a compiler to standards conformance is a
painful thing for developers _and_ users.
Is there a command line flag that could have given me the hint for
#include <iterator>?
No bug, just a different YASH (yet another standard header) to include
additionally ...
AFAIS Strostroup Chapter 19 gives no hint on where to put class iterator
...
is this implementation specific?
Markus
Some test code that survived gcc-3.0, but not gcc-3.1:
#include <list>
#include <iostream>
//#include <iterator>
using namespace std; // see comp.lang.c++.moderated for
// what a war this directive can machinate
void SomeFunction(list<int> l) {
std::copy(l.begin(), l.end(), std::ostream_iterator<int>(std::cout, ",
"));
}
int main () {
list<int> l;
l.push_back(3);
l.push_back(5);
SomeFunction(l);
}