C++ library for egcs

Martin von Loewis martin@mira.isdn.cs.tu-berlin.de
Mon Apr 13 12:28:00 GMT 1998


> Only for a pedantic meaning of "correct", that is that yes, it is a
> conforming program, but no, it doesn't do what the user wanted it to
> do when s/he wrote it, and the program won't link.

I was aiming at the pedantic aspect only. Later I found that it isn't
really the template that makes the usage you describe incompatible -
the namespace std alone would have done it. I.e.

class ostream;
namespace std{
  class ostream;
}
using std::ostream;

is already illegal.

> But maybe you are on to something -- it occured to me that we might be
> able to use this fact to do a compatibility hack, if we munge the linker
> to remap foo(ostream&) into foo(basic_ostream<char>&) or add a
> compatibility library that has stub functions to do this.

A compatibility library might actually work. <iostream.h> would then
read

class ostream: public std::ostream{};

The only question is what ::cout would be.

Martin



More information about the Gcc mailing list