From -4667262581016500414
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,307cbe6f0ea2ccd3
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-06-11 12:09:24 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: tslettebo@chello.no.nospam ("Terje Slettebo")
Newsgroups: comp.std.c++
Subject: Re: Recommendation to the Standards Committee
Date: Wed, 11 Jun 2003 19:09:23 +0000 (UTC)
Lines: 57
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <6B9Fa.11025$KF1.272008@amstwist00>
References: <ohQDa.44053$4_1.12732776@twister.nyc.rr.com> <_ULEa.10852$KF1.271850@amstwist00> <3EE50908.9060202@hotmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
X-Trace: mail2news.demon.co.uk 1055358563 28569 10.0.0.1 (11 Jun 2003 19:09:23 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 11 Jun 2003 19:09:23 +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 19QAyH-0007Qe-00
	for mail2news@news.news.demon.net; Wed, 11 Jun 2003 19:09:22 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id FAA15797; Thu, 12 Jun 2003 05:09:18 +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: Tue, 10 Jun 2003 02:26:42 MET DST
X-Spam-Status: No, hits=1.0 required=5.0
	tests=INVALID_MSGID,PRIORITY_NO_NAME,QUOTED_EMAIL_TEXT,
	      REFERENCES,SATISFACTION,SPAM_PHRASE_00_01
	version=2.41
X-Spam-Level: *
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.cs.mu.OZ.AU id FAA15797
Xref: archiver1.google.com comp.std.c++:19683

"Andrey Tarasevich" <andreytarasevich@hotmail.com> wrote in message
news:3EE50908.9060202@hotmail.com...
>Terje Sletteb=F8 wrote:
>> ""Brian Plummer"" <bplummer@nyc.rr.com> wrote in message
>> news:ohQDa.44053$4_1.12732776@twister.nyc.rr.com...
>>
>> 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=3DXns9343937778AB1conley141osuedu%4065.
>> 24.2.11).

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

The way I understand the #once proposal is that the implementation would
remember which files contain it, and which have already been included
during compilation, so that if they are requested again, in an include
directive, they are not even opened, as you say. This would accomplish
what he asked for, without having to have external guards.

I agree with you that if #once only replaced #ifdef/#define/#endif,
there wouldn't be much point with it.

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

In this case, the "internal" solution has the same effect as his
"external" one.


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                       ]



