From 6474250829291588910
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,307cbe6f0ea2ccd3
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-06-11 12:10:04 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: fjh@cs.mu.OZ.AU (Fergus Henderson)
Newsgroups: comp.std.c++
Subject: Re: Recommendation to the Standards Committee
Date: Wed, 11 Jun 2003 19:10:02 +0000 (UTC)
Organization: Computer Science, University of Melbourne
Lines: 30
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <bc4er7$1v0$1@mulga.cs.mu.OZ.AU>
References: <ohQDa.44053$4_1.12732776@twister.nyc.rr.com>
X-Trace: mail2news.demon.co.uk 1055358602 28603 10.0.0.1 (11 Jun 2003 19:10:02 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 11 Jun 2003 19:10:02 +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 19QAyu-0007RC-00
	for mail2news@news.news.demon.net; Wed, 11 Jun 2003 19:10:01 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id FAA15968; Thu, 12 Jun 2003 05:09:58 +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-NNTP-Posting-Date: 10 Jun 2003 11:19:03 GMT
X-Spam-Status: No, hits=-7.1 required=5.0
	tests=EMAIL_ATTRIBUTION,INVALID_MSGID,NOSPAM_INC,REFERENCES,
	      SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01
	version=2.41
Xref: archiver1.google.com comp.std.c++:19686

bplummer@nyc.rr.com ("Brian Plummer") writes:

>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.

This technique is a bad way to solve the problem.  It puts a significant
burden on C/C++ programmers, forever.

A much better way of solving the problem is for C/C++ implementors to
implement the "header guard optimization", i.e. to avoid opening header
files twice if they contains the usual kind of header file guard, and
the macro which is used as the guard has not been #undef'd since the
file was last included.  Good C/C++ implementations were already doing
this optimization years ago.  If your favourite C/C++ implementation
doesn't do this already, then lobby the vendor to do so, or switch to GCC!

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

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



