This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

#include <iterator> (was Re: `ostream_iterator' undeclared in namespace `std'?)


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);
}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]