From -6481344554151692524
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,307cbe6f0ea2ccd3
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-06-09 16:05:52 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!colt.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: andreytarasevich@hotmail.com (Andrey Tarasevich)
Newsgroups: comp.std.c++
Subject: Re: Recommendation to the Standards Committee
Date: Mon, 9 Jun 2003 23:05:51 +0000 (UTC)
Organization: Posted via Supernews, http://www.supernews.com
Lines: 52
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <3EE50908.9060202@hotmail.com>
References: <ohQDa.44053$4_1.12732776@twister.nyc.rr.com> <_ULEa.10852$KF1.271850@amstwist00>
Mime-Version: 1.0
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
X-Trace: mail2news.demon.co.uk 1055199951 18418 10.0.0.1 (9 Jun 2003 23:05:51 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 9 Jun 2003 23:05:51 +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 19PVi2-0004mv-00
	for mail2news@news.news.demon.net; Mon, 09 Jun 2003 23:05:50 +0000
X-Received: by mulga.cs.mu.OZ.AU
	id JAA06163; Tue, 10 Jun 2003 09:05:47 +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-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
X-Accept-Language: en-us, en
X-Spam-Status: No, hits=-8.1 required=5.0
	tests=FORGED_HOTMAIL_RCVD,NOSPAM_INC,QUOTED_EMAIL_TEXT,
	      REFERENCES,SATISFACTION,SIGNATURE_SHORT_DENSE,
	      SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MOZILLA_UA,
	      X_ACCEPT_LANG
	version=2.41
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.cs.mu.OZ.AU id JAA06163
Xref: archiver1.google.com comp.std.c++:19672

Terje Sletteb=F8 wrote:
> ""Brian Plummer"" <bplummer@nyc.rr.com> wrote in message
> news:ohQDa.44053$4_1.12732776@twister.nyc.rr.com...
>> ...
>> 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
> ...
> 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.
>=20
> The thread is here
> (http://www.google.com/groups?selm=3DXns9343937778AB1conley141osuedu%40=
65.
> 24.2.11).
> ...

Yeah, but it looks like the main point of the method Brian is using is th=
at
the guarding '#ifndef'/'#endif' is placed _outside_ the header file. In t=
his
case the preprocessor doesn't even have to search for already included
files, open them or try parsing them. The '#once' solution doesn't help i=
n
this case, since '#once' directive is supposed to be specified _inside_
header files. From this respect '#once' is not much different from the
standard  "internal '#ifndef'/'#define'/'#endif' approach". But it looks
like Brian is not satisfied with the latter. Under this circumstances, I
don't think he will be satisfied with any other "internal" solution.

--=20
Best regards,
Andrey Tarasevich
Brainbench C and C++ Programming MVP

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



