public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Phil Edwards <phil@jaj.com>
To: Robert Schweikert <rjschwei@cox.net>
Cc: Gabriel Dos Reis <gdr@integrable-solutions.net>, gcc <gcc@gcc.gnu.org>
Subject: Re: iostream question
Date: Thu, 17 Oct 2002 06:51:00 -0000	[thread overview]
Message-ID: <20021016205701.A24981@disaster.jaj.com> (raw)
In-Reply-To: <3DAE09E5.2040002@cox.net>; from rjschwei@cox.net on Wed, Oct 16, 2002 at 08:52:53PM -0400

On Wed, Oct 16, 2002 at 08:52:53PM -0400, Robert Schweikert wrote:
> OK,
> 
> Are you saying I can no longer forward declare an ostream?

Yes, but you don't want to forward declare an ostream anymore.

    class ostream;

isn't legal, because it doesn't match the real ostream.


> That would mean that for a declaration like so
> 
> ostream& operator<< (ostream&, const myClass);
> 
> I have to include the iostream header file in my header file. That seems
> odd. There's got to be a better way.

There is, called <iosfwd>.  All the I/O classes, forward declared.


Phil

-- 
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
                                                 - Edsger Dijkstra, 1930-2002

      reply	other threads:[~2002-10-17  0:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-15  3:50 Robert Schweikert
2002-10-15  4:29 ` Gabriel Dos Reis
2002-10-17  6:51   ` Robert Schweikert
2002-10-17  6:51     ` Phil Edwards [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021016205701.A24981@disaster.jaj.com \
    --to=phil@jaj.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gdr@integrable-solutions.net \
    --cc=rjschwei@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).