From -6406893598990051224
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,307cbe6f0ea2ccd3
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-06-11 12:24:40 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: ark@research.att.com (Andrew Koenig)
Newsgroups: comp.std.c++
Subject: Re: Recommendation to the Standards Committee
Date: Wed, 11 Jun 2003 19:24:39 +0000 (UTC)
Organization: AT&T Shannon Laboratory, Florham Park, NJ
Lines: 29
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <yu993cigwwgf.fsf@europa.research.att.com>
References: <ohQDa.44053$4_1.12732776@twister.nyc.rr.com> <_ULEa.10852$KF1.271850@amstwist00> <3EE50908.9060202@hotmail.com> <k+yc72ENhb5+EweX@robinton.demon.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: mail2news.demon.co.uk 1055359479 28709 10.0.0.1 (11 Jun 2003 19:24:39 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 11 Jun 2003 19:24:39 +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 19QBD4-0007Su-00
	for mail2news@news.news.demon.net; Wed, 11 Jun 2003 19:24:39 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id FAA17103; Thu, 12 Jun 2003 05:24:35 +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-Host: europa.research.att.com
X-User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3
X-Spam-Status: No, hits=-6.6 required=5.0
	tests=NOSPAM_INC,REFERENCES,SIGNATURE_SHORT_DENSE,
	      SPAM_PHRASE_00_01,UNDISC_RECIPS,USER_AGENT
	version=2.41
Xref: archiver1.google.com comp.std.c++:19693

Francis> Being able to write:

Francis> #once

Francis> at the start of a header file would solve the problem because
Francis> compilers would then read the file the first time, mark it as
Francis> read in its tables and not try to read it again.

There are already compilers that detect header files of the form

        #ifndef <symbol>

                anything

        #endif

(and similarly for #ifdef), and decline to process the file a second
time if <symbol> is set (or unset) when the file is included a second
time.  For such compilers, no special directives are needed.

-- 
Andrew Koenig, ark@research.att.com, http://www.research.att.com/info/ark

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



