From -1227347609793249575
X-Google-Thread: f78e5,d9988170196edb06
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.google.com!news.glorb.com!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: "Roger Orr" <rogero@howzatt.demon.co.uk>
Newsgroups: comp.std.c++
Subject: Re: Other headers #included via iostream
Date: 19 Jul 2005 23:10:02 GMT
Organization: "Altopia Corp. - Usenet Access - www.altopia.com"
Lines: 35
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <dbk0q4$1du$1$8300dec7@news.demon.co.uk>
References: <si3qd1l5ls9fmjbiatgmrcgetbcp6qbss6@4ax.com>
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Delivered-To: std-c++@ucar.edu
X-Trace: news.demon.co.uk 1121814148 1470 80.177.1.3 (19 Jul 2005 23:02:28 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 19 Jul 2005 23:02:28 +0000 (UTC)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.326
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.3790.326
X-MSMail-Priority: Normal
X-Greylisting: NO DELAY (Relay+Sender autoqualified);
	processed by UCSD_GL-v1.3 on mailbox8.ucsd.edu;
	Tue, 19 July 2005 16:06:47 -0700 (PDT)
X-Spamscanner: mailbox8.ucsd.edu  (v1.6 Apr  6 2005 07:48:50, -1.6/5.0 3.0.0)
X-MailScanner: PASSED (v1.2.8 65726 j6JN2VkD069079 mailbox8.ucsd.edu)
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
X-Virus-Scanned: amavisd-new at cs.mu.OZ.AU
Xref: g2news1.google.com comp.std.c++:1399

<zerotIPredictNoSpammingype@yahoo.com> wrote in message
news:si3qd1l5ls9fmjbiatgmrcgetbcp6qbss6@4ax.com...
> Hi,
>
> As most of you probably already know, depending on which
> implementation of C++ you have, #include <iostream> may cause various
> other headers to be #included too. (I've observed cstring, cstdio,
> cmath and I think cstdlib in g++)
>
> Are there any that the standard requires to be "dragged in" like this
> regardless of implementation?

No - in fact all that is required is the declaration of cin, cout, cerr and
clog and the
wide character equivalents.

Why do you want to know?
In general do not make _any_ assumptions about the 'other' header files
which may be included by a standard header - explicitly include what you
need.
I know this is easier said than done, but it improves portability (across
platforms, or even across versions of compiler) if you try to do this.

Regards,
Roger Orr
--
MVP in C++ at www.brainbench.com


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



