220 29190 <6EE5A060-93D1-465E-BE2C-E386EFAB4BF3@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Miro Knejp <miro.knejp@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: pragma once
Date: Fri, 28 Oct 2016 12:53:30 +0200
Lines: 287
Approved: news@gmane.org
Message-ID: <6EE5A060-93D1-465E-BE2C-E386EFAB4BF3@gmail.com>
References: <CAGz9X0c=CNLVEGgJ7=GJ2W+7fsvN7h+tbiFyf5Cx3aab0Xb=rQ@mail.gmail.com> <ffa0cf8c-25a4-49fe-9e99-dcce452b8dd6@isocpp.org> <2c278558-0dbc-4568-9b6b-7f159c94707e@isocpp.org> <4610802.tOzma7na2T@tjmaciei-mobl1> <fefab967-9db3-7204-a2d0-b9984ca5e8b4@gmail.com> <CAGg_6+OFUqxzy-3YErVKS0-4dU2TxLrJjev9TGWKOA1v8Lnp3g@mail.gmail.com> <CAEhD+6BXvsZ+NJgnbX3yiGQWQRzWODYz-NfG8p3U++Au90cKjA@mail.gmail.com> <fe951191-2e5b-654f-41c5-577a3e106423@gmail.com> <511f665a-6c17-79cf-a020-889a4045cc95@gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_FA867F6E-3636-4585-972B-86B607DF7472"
X-Trace: blaine.gmane.org 1477652025 14531 195.159.176.226 (28 Oct 2016 10:53:45 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 28 Oct 2016 10:53:45 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC6ONSXJ54LBBLG4ZTAAKGQE3UUPKXQ@isocpp.org Fri Oct 28 12:53:40 2016
Return-path: <std-proposals+bncBC6ONSXJ54LBBLG4ZTAAKGQE3UUPKXQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f69.google.com ([74.125.82.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC6ONSXJ54LBBLG4ZTAAKGQE3UUPKXQ@isocpp.org>)
	id 1c04mw-00024v-RZ
	for gclcip-std-proposals@m.gmane.org; Fri, 28 Oct 2016 12:53:30 +0200
Original-Received: by mail-wm0-f69.google.com with SMTP id 2sf27887934wmj.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 28 Oct 2016 03:53:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:mime-version:subject:date:references:to:in-reply-to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=KB3hWV1Pjs2Q4mrcxrLrw8Yn5ycbM1XWKYWm7t70Les=;
        b=vw6csxeuHZGa5RSxrP710ud8+HkV3ohZ1GsHVlO+h1j3mYMn2oZAiunkKuzutSUk2Q
         FHFaX8pbq3AooGD9x4LuRsYKo8HMKp4X9fTuACXpXLIGEIp5IARx+JZAqUWfC1pmM2nc
         DCDkgE01BBYvAd1UyVFFK2f3akJtTU4/bahhYF6qlLiI/F7n22z+icryjjzRy3jpxVbc
         Sej0RqUVdaLVQO82NCBe+a5ei1K/DCaVo/h5XXsKvLjkraui8NJYcuxxEERAtVL1nLlv
         BlmmxGgzcGN+BBnbprVH18WesBFpB/l1qsE9QKXBD4TMb3dxf3w1ylCIQjRPXUDXUpAC
         v8tw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:mime-version:subject:date
         :references:to:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=KB3hWV1Pjs2Q4mrcxrLrw8Yn5ycbM1XWKYWm7t70Les=;
        b=B++1oB8dPljoZ/VpHt7yOqahrGjFGZTtcx5XV2tXVGBj+w1cCr6yhrlxG9fw03wswM
         X5QbXjB3wmF03y8CGcDxIz9dhOGViQsj6BD4wJsCUVtakS5+NQbDgLVQAckAy1QEoiE4
         V0sBmcjWl/uE0y1dYeLrb698QEdDM1gM947MJyhtDQs1sHr7ckapwqivkDQ+V8lhDIcD
         ZVHpA7bdd25hosPDymFKybsR1hnOLHCsbExZObj5GGAXFDtQq9lFmZZkploB3+9a27kZ
         ObrCx/HjlA3D6NIqFLVt+XhGj4WDn80bZD09DWdT70QaR6dJrw1daFx9w7/eiMBpKyFy
         k+kw==
X-Gm-Message-State: ABUngvf1ixUxggWMjtngRl3O2jD+aPlpdStWu7gmNmiSTLzLrUlqqAyKQOmRLU6szmP3CA==
X-Received: by 10.28.193.196 with SMTP id r187mr232099wmf.5.1477652013683;
        Fri, 28 Oct 2016 03:53:33 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.193.74 with SMTP id r71ls365665wmf.6.gmail; Fri, 28 Oct
 2016 03:53:32 -0700 (PDT)
X-Received: by 10.28.125.67 with SMTP id y64mr2364484wmc.65.1477652012295;
        Fri, 28 Oct 2016 03:53:32 -0700 (PDT)
Original-Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com. [2a00:1450:400c:c09::241])
        by mx.google.com with ESMTPS id 7si9236912wmr.108.2016.10.28.03.53.32
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 28 Oct 2016 03:53:32 -0700 (PDT)
Received-SPF: pass (google.com: domain of miro.knejp@gmail.com designates 2a00:1450:400c:c09::241 as permitted sender) client-ip=2a00:1450:400c:c09::241;
Original-Received: by mail-wm0-x241.google.com with SMTP id c17so6878108wmc.3
        for <std-proposals@isocpp.org>; Fri, 28 Oct 2016 03:53:32 -0700 (PDT)
X-Received: by 10.194.168.129 with SMTP id zw1mr13288231wjb.26.1477652011574;
        Fri, 28 Oct 2016 03:53:31 -0700 (PDT)
Original-Received: from [172.16.1.80] ([87.191.28.122])
        by smtp.gmail.com with ESMTPSA id 194sm8990250wmj.0.2016.10.28.03.53.30
        for <std-proposals@isocpp.org>
        (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
        Fri, 28 Oct 2016 03:53:30 -0700 (PDT)
In-Reply-To: <511f665a-6c17-79cf-a020-889a4045cc95@gmail.com>
X-Mailer: Apple Mail (2.3124)
X-Original-Sender: miro.knejp@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 miro.knejp@gmail.com designates 2a00:1450:400c:c09::241 as permitted sender)
 smtp.mailfrom=miro.knejp@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=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:29190
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/29190>


--Apple-Mail=_FA867F6E-3636-4585-972B-86B607DF7472
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 28 Oct 2016, at 11:50 , Andrey Semashev <andrey.semashev@gmail.com> wr=
ote:
>=20
> On 10/28/16 02:48, Miro Knejp wrote:
>> Am 28.10.2016 um 01:06 schrieb Andrey Semashev:
>>> On Fri, Oct 28, 2016 at 1:17 AM, Nevin Liber <nevin@eviloverlord.com>
>>> wrote:
>>>> 3. The OS doesn't know if the files have the same content.  I'm
>>>> pretty sure
>>>> this would require an extra pass to compute the fingerprint hash, as y=
ou
>>>> shouldn't be processing the file until you are sure it is unique.
>>>> You still
>>>> have to scan for include guards as that is just normal macro processin=
g.
>>> As I shown earlier, basing the decision on the hash can result in
>>> incorrect result. IMO, content equivalence is not the right criteria
>>> for skipping file inclusion.
> >
>> Your example doesn't work precisely *because* the behavior of #pragma
>> once isn't specified. Anyone can come up with a contrived example that
>> breaks a feature which hasn't been defined yet, implying the feature
>> must be impossible because it cannot solve an artificial use case it
>> probably isn't even designed to solve.
>=20
> That example breaks assuming #once relies on hashing the header, which is=
 what you suggested above.
That really depends on how your example came into existence. The way I unde=
rstood is that =E2=80=9Ca" and =E2=80=9Cb=E2=80=9D are both part of the sam=
e project and therefore the project author is in control and responsible fo=
r how the files are organized and therefore wouldn=E2=80=99t use #once in t=
he first place. Otherwise if =E2=80=9Ca=E2=80=9D and =E2=80=9Cb=E2=80=9D ar=
e external libraries why would someone symlink two headers of two libraries=
 into one? That just seems like a really bad idea to me.

Everyone can come up with infinite examples where every new proposed featur=
e breaks. The question is always: does it aim at solving them all? I say no=
..
>=20
>> If such a utility is added (whatever it ends up being called) and it has
>> clearly defined rules then this "trick" only works if it conforms to the
>> rules of the new feature. If it doesn't then you have to simply resolve
>> to include guards for such preprocessor voodoo. But at that point you as
>> the author of the project know whether you can use this feature or not
>> because it has (hopefully) clearly specified behavior and as such you
>> should then know whether or not you can setup your files the way describ=
ed.
>>>=20
>>> I think a proposal similar to the previously mentioned "#once
>>> guard_phrase" has more potential. It does give the user a way to
>>> indicate file equivalence (through the guard name) and also is
>>> arguably less expensive than computing a hash value.
>>>=20
>> It unfortunately doesn't solve the problem of having to come up wth a
>> guard that is unique within the multiverse. For example boost_date_time
>> has an include guard called ISO_FORMAT_HPP___. That's not exactly the
>> most unique guard in the world. The less this relies on human
>> (non-)creativity or discipline the better.
>=20
> The important benefit of that approach is that the user is still in contr=
ol to solve the issue - he can simply modify the guard to be more unique. Y=
ou could argue that the user could modify any part of the header to change =
its hash, and that's true. But as a user of the library, I would be much mo=
re confident modifying the guard - the element that is precisely aimed at s=
olving the problem - than any unrelated part of the header, even a comment.
>=20
>> Like many modern C++ improvements it's trying to create a sensible
>> default. If that default doesn't work for (hopefully rare) use cases
>> then you can always revert to the previous method.
>=20
> The problem with the "if it doesn't work for you, use the traditional inc=
lude guards" argument is that it doesn't work for library developers becaus=
e they generally don't know how their library will be used and whether #onc=
e can fail in those conditions. If #once doesn't offer the same degree of p=
ortability as include guards, the latter are always preferable and there si=
mply is no reason to use #once.
If I publish a library I can at least expect that users don=E2=80=99t symli=
nk one of my headers into the header of a different library just because th=
ey can. Unless this is an exclusively announced and agreed on  compatibilit=
y feature with the another library author in which case I wouldn=E2=80=99t =
use #once for the file.

Even though I do not know how someone is going to use my library I can expe=
ct a certain amount of common sense. If they *do* break their code because =
of symlink shenanigans between libraries then, to be frank, that=E2=80=99s =
*their* problem and I=E2=80=99m not gonna lift a finger to fix it for them.

--=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/6EE5A060-93D1-465E-BE2C-E386EFAB4BF3%40gmail.com=
..

--Apple-Mail=_FA867F6E-3636-4585-972B-86B607DF7472
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 28 Oct 2016, at 1=
1:50 , Andrey Semashev &lt;<a href=3D"mailto:andrey.semashev@gmail.com" cla=
ss=3D"">andrey.semashev@gmail.com</a>&gt; wrote:</div><br class=3D"Apple-in=
terchange-newline"><div class=3D""><span style=3D"font-family: Helvetica; f=
ont-size: 12px; font-style: normal; font-variant-caps: normal; font-weight:=
 normal; letter-spacing: normal; orphans: auto; text-align: start; text-ind=
ent: 0px; text-transform: none; white-space: normal; widows: auto; word-spa=
cing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !im=
portant;" class=3D"">On 10/28/16 02:48, Miro Knejp wrote:</span><br style=
=3D"font-family: Helvetica; font-size: 12px; font-style: normal; font-varia=
nt-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto=
; text-align: start; text-indent: 0px; text-transform: none; white-space: n=
ormal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" cl=
ass=3D""><blockquote type=3D"cite" style=3D"font-family: Helvetica; font-si=
ze: 12px; font-style: normal; font-variant-caps: normal; font-weight: norma=
l; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0=
px; text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;" class=3D"">Am 28.10.2016 um 01:06 sch=
rieb Andrey Semashev:<br class=3D""><blockquote type=3D"cite" class=3D"">On=
 Fri, Oct 28, 2016 at 1:17 AM, Nevin Liber &lt;<a href=3D"mailto:nevin@evil=
overlord.com" class=3D"">nevin@eviloverlord.com</a>&gt;<br class=3D"">wrote=
:<br class=3D""><blockquote type=3D"cite" class=3D"">3. The OS doesn't know=
 if the files have the same content. &nbsp;I'm<br class=3D"">pretty sure<br=
 class=3D"">this would require an extra pass to compute the fingerprint has=
h, as you<br class=3D"">shouldn't be processing the file until you are sure=
 it is unique.<br class=3D"">You still<br class=3D"">have to scan for inclu=
de guards as that is just normal macro processing.<br class=3D""></blockquo=
te>As I shown earlier, basing the decision on the hash can result in<br cla=
ss=3D"">incorrect result. IMO, content equivalence is not the right criteri=
a<br class=3D"">for skipping file inclusion.<br class=3D""></blockquote></b=
lockquote><span style=3D"font-family: Helvetica; font-size: 12px; font-styl=
e: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; orphans: auto; text-align: start; text-indent: 0px; text-transform:=
 none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-s=
troke-width: 0px; float: none; display: inline !important;" class=3D"">&gt;=
</span><br style=3D"font-family: Helvetica; font-size: 12px; font-style: no=
rmal; font-variant-caps: normal; font-weight: normal; letter-spacing: norma=
l; orphans: auto; text-align: start; text-indent: 0px; text-transform: none=
; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke=
-width: 0px;" class=3D""><blockquote type=3D"cite" style=3D"font-family: He=
lvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; fo=
nt-weight: normal; letter-spacing: normal; orphans: auto; text-align: start=
; text-indent: 0px; text-transform: none; white-space: normal; widows: auto=
; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D"">Your examp=
le doesn't work precisely *because* the behavior of #pragma<br class=3D"">o=
nce isn't specified. Anyone can come up with a contrived example that<br cl=
ass=3D"">breaks a feature which hasn't been defined yet, implying the featu=
re<br class=3D"">must be impossible because it cannot solve an artificial u=
se case it<br class=3D"">probably isn't even designed to solve.<br class=3D=
""></blockquote><br style=3D"font-family: Helvetica; font-size: 12px; font-=
style: normal; font-variant-caps: normal; font-weight: normal; letter-spaci=
ng: normal; orphans: auto; text-align: start; text-indent: 0px; text-transf=
orm: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-te=
xt-stroke-width: 0px;" class=3D""><span style=3D"font-family: Helvetica; fo=
nt-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; orphans: auto; text-align: start; text-inde=
nt: 0px; text-transform: none; white-space: normal; widows: auto; word-spac=
ing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !imp=
ortant;" class=3D"">That example breaks assuming #once relies on hashing th=
e header, which is what you suggested above.</span><br style=3D"font-family=
: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal=
; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: s=
tart; text-indent: 0px; text-transform: none; white-space: normal; widows: =
auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""></div>=
</blockquote>That really depends on how your example came into existence. T=
he way I understood is that =E2=80=9Ca" and =E2=80=9Cb=E2=80=9D are both pa=
rt of the same project and therefore the project author is in control and r=
esponsible for how the files are organized and therefore wouldn=E2=80=99t u=
se #once in the first place. Otherwise if =E2=80=9Ca=E2=80=9D and =E2=80=9C=
b=E2=80=9D are external libraries why would someone symlink two headers of =
two libraries into one? That just seems like a really bad idea to me.</div>=
<div><br class=3D""></div><div>Everyone can come up with infinite examples =
where every new proposed feature breaks. The question is always: does it ai=
m at solving them all? I say no.<br class=3D""><blockquote type=3D"cite" cl=
ass=3D""><div class=3D""><br style=3D"font-family: Helvetica; font-size: 12=
px; font-style: normal; font-variant-caps: normal; font-weight: normal; let=
ter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; te=
xt-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -=
webkit-text-stroke-width: 0px;" class=3D""><blockquote type=3D"cite" style=
=3D"font-family: Helvetica; font-size: 12px; font-style: normal; font-varia=
nt-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto=
; text-align: start; text-indent: 0px; text-transform: none; white-space: n=
ormal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" cl=
ass=3D"">If such a utility is added (whatever it ends up being called) and =
it has<br class=3D"">clearly defined rules then this "trick" only works if =
it conforms to the<br class=3D"">rules of the new feature. If it doesn't th=
en you have to simply resolve<br class=3D"">to include guards for such prep=
rocessor voodoo. But at that point you as<br class=3D"">the author of the p=
roject know whether you can use this feature or not<br class=3D"">because i=
t has (hopefully) clearly specified behavior and as such you<br class=3D"">=
should then know whether or not you can setup your files the way described.=
<br class=3D""><blockquote type=3D"cite" class=3D""><br class=3D"">I think =
a proposal similar to the previously mentioned "#once<br class=3D"">guard_p=
hrase" has more potential. It does give the user a way to<br class=3D"">ind=
icate file equivalence (through the guard name) and also is<br class=3D"">a=
rguably less expensive than computing a hash value.<br class=3D""><br class=
=3D""></blockquote>It unfortunately doesn't solve the problem of having to =
come up wth a<br class=3D"">guard that is unique within the multiverse. For=
 example boost_date_time<br class=3D"">has an include guard called ISO_FORM=
AT_HPP___. That's not exactly the<br class=3D"">most unique guard in the wo=
rld. The less this relies on human<br class=3D"">(non-)creativity or discip=
line the better.<br class=3D""></blockquote><br style=3D"font-family: Helve=
tica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-=
weight: normal; letter-spacing: normal; orphans: auto; text-align: start; t=
ext-indent: 0px; text-transform: none; white-space: normal; widows: auto; w=
ord-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><span style=
=3D"font-family: Helvetica; font-size: 12px; font-style: normal; font-varia=
nt-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto=
; text-align: start; text-indent: 0px; text-transform: none; white-space: n=
ormal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; flo=
at: none; display: inline !important;" class=3D"">The important benefit of =
that approach is that the user is still in control to solve the issue - he =
can simply modify the guard to be more unique. You could argue that the use=
r could modify any part of the header to change its hash, and that's true. =
But as a user of the library, I would be much more confident modifying the =
guard - the element that is precisely aimed at solving the problem - than a=
ny unrelated part of the header, even a comment.</span><br style=3D"font-fa=
mily: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: no=
rmal; font-weight: normal; letter-spacing: normal; orphans: auto; text-alig=
n: start; text-indent: 0px; text-transform: none; white-space: normal; wido=
ws: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><b=
r style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; fon=
t-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphan=
s: auto; text-align: start; text-indent: 0px; text-transform: none; white-s=
pace: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0=
px;" class=3D""><blockquote type=3D"cite" style=3D"font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight=
: normal; letter-spacing: normal; orphans: auto; text-align: start; text-in=
dent: 0px; text-transform: none; white-space: normal; widows: auto; word-sp=
acing: 0px; -webkit-text-stroke-width: 0px;" class=3D"">Like many modern C+=
+ improvements it's trying to create a sensible<br class=3D"">default. If t=
hat default doesn't work for (hopefully rare) use cases<br class=3D"">then =
you can always revert to the previous method.<br class=3D""></blockquote><b=
r style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; fon=
t-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphan=
s: auto; text-align: start; text-indent: 0px; text-transform: none; white-s=
pace: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0=
px;" class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; fon=
t-style: normal; font-variant-caps: normal; font-weight: normal; letter-spa=
cing: normal; orphans: auto; text-align: start; text-indent: 0px; text-tran=
sform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-=
text-stroke-width: 0px; float: none; display: inline !important;" class=3D"=
">The problem with the "if it doesn't work for you, use the traditional inc=
lude guards" argument is that it doesn't work for library developers becaus=
e they generally don't know how their library will be used and whether #onc=
e can fail in those conditions. If #once doesn't offer the same degree of p=
ortability as include guards, the latter are always preferable and there si=
mply is no reason to use #once.</span></div></blockquote></div>If I publish=
 a library I can at least expect that users don=E2=80=99t symlink one of my=
 headers into the header of a different library just because they can. Unle=
ss this is an exclusively announced and agreed on &nbsp;compatibility featu=
re with the another library author in which case I wouldn=E2=80=99t use #on=
ce for the file.<div class=3D""><br class=3D""></div><div class=3D"">Even t=
hough I do not know how someone is going to use my library I can expect a c=
ertain amount of common sense. If they *do* break their code because of sym=
link shenanigans between libraries then, to be frank, that=E2=80=99s *their=
* problem and I=E2=80=99m not gonna lift a finger to fix it for them.<div c=
lass=3D""><br class=3D""></div></div></body></html>

<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/6EE5A060-93D1-465E-BE2C-E386EFAB4BF3%=
40gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/6EE5A060-93D1-465E-BE2C-E386EFAB4BF3%=
40gmail.com</a>.<br />

--Apple-Mail=_FA867F6E-3636-4585-972B-86B607DF7472--

.
