From -6506829599027772958
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,307cbe6f0ea2ccd3
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-06-11 12:12:49 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!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: Wed, 11 Jun 2003 19:12:48 +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: <3EE62B88.6030208@hotmail.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=KOI8-R
Content-Transfer-Encoding: 7bit
X-Trace: mail2news.demon.co.uk 1055358768 28625 10.0.0.1 (11 Jun 2003 19:12:48 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 11 Jun 2003 19:12:48 +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 19QB1b-0007RX-00
	for mail2news@news.news.demon.net; Wed, 11 Jun 2003 19:12:47 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id FAA16248; Thu, 12 Jun 2003 05:12:44 +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.8 required=5.0
	tests=FORGED_HOTMAIL_RCVD,NOSPAM_INC,QUOTED_EMAIL_TEXT,
	      REFERENCES,SATISFACTION,SIGNATURE_SHORT_DENSE,
	      SPAM_PHRASE_01_02,USER_AGENT,USER_AGENT_MOZILLA_UA,
	      X_ACCEPT_LANG
	version=2.41
Xref: archiver1.google.com comp.std.c++:19688

Francis Glassborow wrote:
> In article <3EE50908.9060202@hotmail.com>, Andrey Tarasevich 
> <andreytarasevich@hotmail.com> writes
>>Yeah, but it looks like the main point of the method Brian is using is that
>>the guarding '#ifndef'/'#endif' is placed _outside_ the header file. In this
>>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 in
>>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.
> 
> But I do not understand the problem. Only the designer of a header file 
> can know if it should or should not be multiply included into a TU.
> 
> Being able to write:
> 
> #once
> 
> at the start of a header file would solve the problem because compilers 
> would then read the file the first time, mark it as read in its tables 
> and not try to read it again.

Well, it all depends on the concrete specification of '#once'. BTW, if it
will work is accordance with your suggestion, it won't matter whether it is
specified at the start of a header file or in the middle of it. Note also
that in order to support this specification '#once' directive should be
always "visible" regardless of the surrounding '#ifdef'/'#endif' context,
thus outlawing such techniques as the following

  #define SUPPRESS_ONCE
  ...

  #ifndef SUPPRESS_ONCE
  #once
  #endif // SUPPRESS_ONCE

OK, as others already noted, it has been discussed to death here. I guess I
should look through previous discussions first.

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



