This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: breaking compatibility
- To: "Loren Osborn" <loren at reflexive dot net>,<libstdc++ at gcc dot gnu dot org>
- Subject: RE: breaking compatibility
- From: "Stephen M. Webb" <stephen at bregmasoft dot com>
- Date: Thu, 19 Apr 2001 15:41:44 -0400
> Loren Osborn scribbles:
>
> I wish it were that easy... if it were I would just as soon just #include
> <istream.h> and be done with it... The truth of the matter is
> that we had to
> make and conform to certain #include-ing conventions to make all of our
> memory checking code work...
>
> our .cpp files generally begin with something like this:
>
> #include "Reflexive.h"
>
> // All required system includes here:
> #include <string.h>
>
> #include "Debug.h"
>
> // All required project includes here:
> #include "FileName.h"
> #include "OtherRequiredFiles.h"
>
> and our .h files are required to never include any system .h files...
The <iosfwd> header is part of the language. If you're going to use the
istream part,
you should be willing to use the <iosfwd> part, since anything else (other
than including
<istream>) is pretty much guaranteed by the ISO standard to be non portable
(because
the library implementor is allowd to add additional parameters to the
templates.
If you have header files that depend on the istream template being declared,
you should
just include <iosfwd> in your .cpp file before any header(s) that reference
it. The <iosfwd>
header contains ONLY forward declarations, not definitions (unlike
<istream>), so it shouldn't
cause any more problems than explicitly specifying the forward template
definition in your code.
Stephen M. Webb