From 1823887708769783842
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,307cbe6f0ea2ccd3
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-06-08 19:04:30 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: tslettebo@chello.no.nospam (=?Windows-1252?Q?Terje_Sletteb=F8?=)
Newsgroups: comp.std.c++
Subject: Re: Recommendation to the Standards Committee
Date: Mon, 9 Jun 2003 02:04:29 +0000 (UTC)
Lines: 50
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <_ULEa.10852$KF1.271850@amstwist00>
References: <ohQDa.44053$4_1.12732776@twister.nyc.rr.com>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="Windows-1252"
Content-Transfer-Encoding: 7bit
X-Trace: mail2news.demon.co.uk 1055124269 14033 10.0.0.1 (9 Jun 2003 02:04:29 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 9 Jun 2003 02:04:29 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.12)
	id 19PC1M-0003eC-00
	for mail2news@news.news.demon.net; Mon, 09 Jun 2003 02:04:28 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id MAA13158; Mon, 9 Jun 2003 12:04:22 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ucar.edu
X-Newsgroups: comp.std.c++
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
X-NNTP-Posting-Date: Sun, 08 Jun 2003 21:12:58 MET DST
X-Spam-Status: No, hits=-1.7 required=5.0
	tests=INVALID_MSGID,PRIORITY_NO_NAME,QUOTED_EMAIL_TEXT,
	      REFERENCES,SPAM_PHRASE_00_01
	version=2.41
Xref: archiver1.google.com comp.std.c++:19663

""Brian Plummer"" <bplummer@nyc.rr.com> wrote in message
news:ohQDa.44053$4_1.12732776@twister.nyc.rr.com...
> I have the following recommendation for an addition to the C++
standard:
>
> I'd like to see the text used for the header guards in the standard
library
> header files, well, standardized.
>
> Why? You ask...
>
> Well, almost all of the code I write is portable to a large number of
> Hardware/OS/Compiler combinations and I (try to) employ a technique to
> reduce compile times discussed by Lakos on pages 82-88 of "Large Scale
C++
> Software Design" which advocates protecting every #include file
directive
> with a redundant check for previous inclusion of said header in the
> translation unit.  An example could be:
>
> #ifndef __IOSTREAM__
> #include <iostream>
> #endif

This only works if you know and can rely on the include guards, as you
say, regardless of what library/include file is used. This creates a
dependency on the implementation of the header (the include guards), and
the code in the including file can be quite messy, tripling the number
of lines dealing with includes.

A better way might be the "#once" directive, which has been discussed
recently, which ensures that the header using it is only included once.
This means you have no dependency on the included file, and files
including it don't need to be changed.

The thread is here
(http://www.google.com/groups?selm=Xns9343937778AB1conley141osuedu%4065.
24.2.11).


Regards,

Terje

---
[ 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                       ]



