220 29140 <e417071f-3473-4d64-8f5d-6e45909acde7@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Aaron McDaid <aaronmcdaid@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: pragma once
Date: Wed, 26 Oct 2016 14:48:53 -0700 (PDT)
Lines: 149
Approved: news@gmane.org
Message-ID: <e417071f-3473-4d64-8f5d-6e45909acde7@isocpp.org>
References: <CAGz9X0c=CNLVEGgJ7=GJ2W+7fsvN7h+tbiFyf5Cx3aab0Xb=rQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_0_2021283399.1477518533838"
X-Trace: blaine.gmane.org 1477518562 18722 195.159.176.226 (26 Oct 2016 21:49:22 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 26 Oct 2016 21:49:22 +0000 (UTC)
Cc: sergeikrivonos@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCE67KWO5UEBBR6JYTAAKGQETNI3P4Q@isocpp.org Wed Oct 26 23:49:17 2016
Return-path: <std-proposals+bncBCE67KWO5UEBBR6JYTAAKGQETNI3P4Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f70.google.com ([209.85.218.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCE67KWO5UEBBR6JYTAAKGQETNI3P4Q@isocpp.org>)
	id 1bzW4A-0001pq-0z
	for gclcip-std-proposals@m.gmane.org; Wed, 26 Oct 2016 23:48:58 +0200
Original-Received: by mail-oi0-f70.google.com with SMTP id n202sf17716585oig.3
        for <gclcip-std-proposals@m.gmane.org>; Wed, 26 Oct 2016 14:49:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=f4jaa4Ktf7xXhM+63i1VGxsgaLqBextXMsg6LWXPa44=;
        b=uptGxebHHwZXXyX6CQxFQnRSGr+gx6OYGHEFNcNe9ogQ+df5D1TM8E1nE3XsML1nmm
         6kJta53zP0/z0/GeX9UYgiimTK6vO1Bvru+paPaTatAwRB/anCzNkGA5U0vRZl5eE88a
         m23m0LhenkVHX/59O+WLEnkFth3+Bei5DJvu5QxtqLbvlnjrQ+mSLBmSDAgt6SwAaYV3
         KptpL1LGfUQA6AyRhdxoujdN4Uj4kawBtBcE4A+jKqulsxxhkFlXFlw0BieJw0VAdspj
         Mk3bxsHXjn4/aGPHyRNAYwOhOkLF9rktTilRtS+nt18x2tnD9m7bPDBX5wj3R5FWQVAU
         2SMQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=f4jaa4Ktf7xXhM+63i1VGxsgaLqBextXMsg6LWXPa44=;
        b=OgUcvk5mWYNNq4XApi/aFwi60+xXjVTRj8dBeEwA1DSm8swo0EMaAL2kVIM7VmZZ+w
         YTI3xkwonUGV/CiStcmSjfy9XUIj0tAfBrFJvJq88ZxwvvwnqWrMDEvDI0O3UtLgDsGd
         tV+wlwd2WdjlWp+iDFZ67Kdi6Og71TyDQnE3gm9AESsYI0c5fV6o1Pt+9Tab+hJT+z7q
         YtIW0At1TROl1uyWt00fL9CUruKJ6iZcLXGyMyHgD7ed1dBIRHUa/R+eVEwPRzaalCAK
         dwe+Cmn0gZ9WmJBB8nWhGO74iRlKkdboLQ5omVW2pqiBoQD/J7OcdJWDsM8Lt6aCkw54
         A5kQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=f4jaa4Ktf7xXhM+63i1VGxsgaLqBextXMsg6LWXPa44=;
        b=FphB3QTFn06sMoEuS3olejGQfXHGeIetojypK4wQDC1D1JVLdpMcWmOfpgaMkdaCxw
         FTLVz7Ptjw94b9KGDhSGOTD7rl62kUeZykFt8IaoSFiGQo/LAHWxxbh59RqT2gxY758E
         zjS/22PaIcBAlgcG9BW/LTJm4r45/nzLxBkyDbPITKOzKYjmwbqYztiD9Q3IL0Mt12pj
         WD8/PSbJePDPDx9Okq+Kjf7Dv5tzdLKQL9NsBv/JB6g1KnLAyZTD2z5ltSEPSzAgU0+X
         YGr9X1A6CNpc6Ex0K7vXEuS7keWQY6quZ6mOM113Fp2MtGlK+CO1EX8WPYQEb15sBdsW
         Btpg==
X-Gm-Message-State: ABUngvcB5B6sGX9awmC0b9429T2uWusIim6ov5NyW/4PH6CVXeNfSsBuXur9OD1xzOR2RQ==
X-Received: by 10.157.1.15 with SMTP id 15mr1558216otu.147.1477518540283;
        Wed, 26 Oct 2016 14:49:00 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.178.80 with SMTP id b77ls694183iof.47.gmail; Wed, 26 Oct
 2016 14:48:55 -0700 (PDT)
X-Received: by 10.36.26.212 with SMTP id 203mr765916iti.2.1477518535552;
        Wed, 26 Oct 2016 14:48:55 -0700 (PDT)
In-Reply-To: <CAGz9X0c=CNLVEGgJ7=GJ2W+7fsvN7h+tbiFyf5Cx3aab0Xb=rQ@mail.gmail.com>
X-Original-Sender: aaronmcdaid@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:29140
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29140>

------=_Part_0_2021283399.1477518533838
Content-Type: multipart/alternative; 
	boundary="----=_Part_1_1609139446.1477518533846"

------=_Part_1_1609139446.1477518533846
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi all,
I'd like to join this conversation by asking everybody to "reset" a little.=
=20
There is no reason whatsoever to think that we need to get distracted about=
=20
filesystem issues.

Also, frankly, the tone of some commentators here is very arrogant. This is=
=20
my first time in an isocpp.org forum and I'm already not impressed with the=
=20
community.


When '#include' is encountered, the compiler will use some arbitrary=20
mechanism to convert the included "pseudo-file-name" into a long string of=
=20
characters. One possible proposal is that, once that long string is fully=
=20
read it, it will be hashed. If a given hash has been encountered before,=20
and the first characters of the long string are `#pragma once`, then only=
=20
the first include will be retained.

That's simple to understand and to define precisely in the standard. I=20
guess it's just a tweak of Phase 4 of the translation phases:=20
http://en.cppreference.com/w/cpp/language/translation_phases

I do not know, nor care, whether the behaviour I have just defined is=20
equivalent to the behaviour currently in any compiler. If there is a subtle=
=20
difference in some extreme case, then I don't care. Are you including two=
=20
different files with the same contents? If so, I don't care if we change=20
the behaviour a little!

There needn't be a speed issue. A naive implemention would be forced to=20
read in all of the header file before processing any of it. But it would be=
=20
easy to optimize this with a little "lookahead" to confirm that a given=20
included-file is indeed novel and therefore the compiler can proceed with=
=20
'single-pass' compilation.

Of course, maybe there is some issue I have overlooked. I'm not claiming to=
=20
be perfect, but I do believe I'm not the only person who thinks '#pragma=20
once' could be standardized in some form if we just showed a little=20
imagination.

If this has been argued to death before, please provide links to the=20
discussion to prove=20

Aaron

On Tuesday, 25 October 2016 08:15:55 UTC+2, =D0=A1=D0=B5=D1=80=D0=B3=D0=B5=
=D0=B9 =D0=9A=D1=80=D0=B8=D0=B2=D0=BE=D0=BD=D0=BE=D1=81 wrote:
>
> Hi,
>
> I see everyone use ifdef or pragma once. It is better to use #pragma=20
> multiple and make #pragma once default.
>
> --=20
> Thanks
> Sergei Krivonos
> skype: sergio_krivonos
>

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/e417071f-3473-4d64-8f5d-6e45909acde7%40isocpp.or=
g.

------=_Part_1_1609139446.1477518533846
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi all,<br>I&#39;d like to join this conversation by askin=
g everybody to &quot;reset&quot; a little. There is no reason whatsoever to=
 think that we need to get distracted about filesystem issues.<br><br>Also,=
 frankly, the tone of some commentators here is very arrogant. This is my f=
irst time in an isocpp.org forum and I&#39;m already not impressed with the=
 community.<br><br><br>When &#39;#include&#39; is encountered, the compiler=
 will use some arbitrary mechanism to convert the included &quot;pseudo-fil=
e-name&quot; into a long string of characters. One possible proposal is tha=
t, once that long string is fully read it, it will be hashed. If a given ha=
sh has been encountered before, and the first characters of the long string=
 are `#pragma once`, then only the first include will be retained.<br><br>T=
hat&#39;s simple to understand and to define precisely in the standard. I g=
uess it&#39;s just a tweak of Phase 4 of the translation phases: http://en.=
cppreference.com/w/cpp/language/translation_phases<br><br>I do not know, no=
r care, whether the behaviour I have just defined is equivalent to the beha=
viour currently in any compiler. If there is a subtle difference in some ex=
treme case, then I don&#39;t care. Are you including two different files wi=
th the same contents? If so, I don&#39;t care if we change the behaviour a =
little!<br><br>There needn&#39;t be a speed issue. A naive implemention wou=
ld be forced to read in all of the header file before processing any of it.=
 But it would be easy to optimize this with a little &quot;lookahead&quot; =
to confirm that a given included-file is indeed novel and therefore the com=
piler can proceed with &#39;single-pass&#39; compilation.<br><br>Of course,=
 maybe there is some issue I have overlooked. I&#39;m not claiming to be pe=
rfect, but I do believe I&#39;m not the only person who thinks &#39;#pragma=
 once&#39; could be standardized in some form if we just showed a little im=
agination.<br><br>If this has been argued to death before, please provide l=
inks to the discussion to prove <br><br>Aaron<br><br>On Tuesday, 25 October=
 2016 08:15:55 UTC+2, =D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9 =D0=9A=D1=80=D0=
=B8=D0=B2=D0=BE=D0=BD=D0=BE=D1=81  wrote:<blockquote class=3D"gmail_quote" =
style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-l=
eft: 1ex;"><div dir=3D"ltr">Hi,<div><br></div><div>I see everyone use ifdef=
 or pragma once. It is better to use #pragma multiple and make #pragma once=
 default.<br clear=3D"all"><div><br></div>-- <br><div>Thanks<br>Sergei Kriv=
onos<br>skype: sergio_krivonos</div>
</div></div>
</blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/e417071f-3473-4d64-8f5d-6e45909acde7%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e417071f-3473-4d64-8f5d-6e45909acde7=
%40isocpp.org</a>.<br />

------=_Part_1_1609139446.1477518533846--

------=_Part_0_2021283399.1477518533838--

.
