This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: breaking compatibility
- To: libstdc++ at gcc dot gnu dot org
- Subject: Re: breaking compatibility
- From: Nathan Myers <ncm at nospam dot cantrip dot org>
- Date: Thu, 19 Apr 2001 13:32:37 -0700
- References: <0102140310.AA13885@ivan.Harhan.ORG> <NEBBIHDGELKPAIGMPLFPOEKECAAA.loren@reflexive.net>
- Reply-To: libstdc++ at gcc dot gnu dot org
On Thu, Apr 19, 2001 at 11:30:12AM -0700, Loren Osborn wrote:
> The first problem I'm having is that I can no longer forward declare
> istream as:
>
> class istream;
>
> since it is now declared as:
>
> typedef class std::basic_istream<char, std::char_traits<char> > istream;
>
> The easiest work around I can think of for this problem would be to,
> instead, declare istream:
>
> class istream : public std::basic_istream<char, std::char_traits<char> >
> {};
This alternative was carefully considered during standardization.
If there were any way it, or something like it, could have been
approved instead, to preserve code with forward declarations, it
would be in the standard now. <iosfwd> was the best that could
be done.
The standard doesn't say anything about <iostream.h> or <istream.h>,
so those could legally have a struct istream; but then they would be
incompatible with the <iostream> and <istream> headers -- you would
have to convert your programs and libraries all at once, without mixing.
Probably you will have to use #ifdefs, and relax the restriction on
including standard headers for the case of <iosfwd>.
Nathan Myers
ncm at cantrip dot org