220 39400 <61682de8-3bf2-42d4-ae19-fcf3bd1d93a0@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: inkwizytoryankes@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Alternative proposal for mapping P0709
 Deterministic Exceptions into C
Date: Wed, 25 Jul 2018 09:43:54 -0700 (PDT)
Lines: 159
Approved: news@gmane.org
Message-ID: <61682de8-3bf2-42d4-ae19-fcf3bd1d93a0@isocpp.org>
References: <6a65c934-5d2a-4e75-b88d-9eaaee338bd3@isocpp.org>
 <1c229827-6d5d-45bd-8766-c3af818b2b0b@isocpp.org> <CAC+0CCP_jeR=fr7a+XVeVJ+0wm4KG9U6iEunOHk3y2qSi3jrjg@mail.gmail.com>
 <4ac80882-16fc-4ab4-9a12-64da1ef0e974@isocpp.org>
 <CAC+0CCPJLYt4frAh+xcSyEpA9qiEdy=O98utgxz2Or5mwMoabw@mail.gmail.com>
 <8866881c-ef1d-4c37-9242-5b1d3327c288@isocpp.org>
 <e8190580-cda9-4899-ba2b-9a0fd5d48073@isocpp.org>
 <363df3db-b747-449f-b95d-81d15b6c3842@isocpp.org>
 <ceee4153-dde7-43a3-b43f-aaf62aa01b60@isocpp.org>
 <edaab808-c155-4369-9be9-e1a0fad36265@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_9634_1944432700.1532537034498"
X-Trace: blaine.gmane.org 1532536911 19278 195.159.176.226 (25 Jul 2018 16:41:51 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 25 Jul 2018 16:41:51 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDDLTAGNTIBBBS6R4LNAKGQEOS3QMYQ@isocpp.org Wed Jul 25 18:41:47 2018
Return-path: <std-proposals+bncBDDLTAGNTIBBBS6R4LNAKGQEOS3QMYQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f198.google.com ([209.85.213.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDDLTAGNTIBBBS6R4LNAKGQEOS3QMYQ@isocpp.org>)
	id 1fiMrB-0004r3-UQ
	for gclcip-std-proposals@m.gmane.org; Wed, 25 Jul 2018 18:41:46 +0200
Original-Received: by mail-yb0-f198.google.com with SMTP id c2-v6sf4211361ybl.16
        for <gclcip-std-proposals@m.gmane.org>; Wed, 25 Jul 2018 09:43:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=B0uDimGfmv4icRbFUugMQgdwkVImdrpQdl09MGY4LiM=;
        b=0TuElxw5M9vnGSNuGNCUrIQujXx/eKjpvzo6LZemhC3lcmzhPk5MzBzb/qR9gvjzh9
         uZNqm2kUhhshWEfxwiPDPQFYwhpydxhdV9TLqIzTgU8l6XCRObJRhDHx0wCtYzCbY0ZC
         KGRbnemddBDxRN61EFNtjs/8We2J004v7QYOH6y6jXLGFqdTxbvzxcyW1MHSIkRBKCu9
         xtNIK98C//3Ktr5p3H8n9OFe1y+/7+gU0MjpZatWz7At+eJvUTkj01NlHJfssB7jCXrd
         bQld+oW9CYBHeHm9C61en4UDEuwqmDjNRq099oEIbCzXlbh/WXAaNY0RHBeVZNS90hAT
         i3AA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=B0uDimGfmv4icRbFUugMQgdwkVImdrpQdl09MGY4LiM=;
        b=u2DEzKey9YKTenP1FST6Uq4Iv5LBslev1+73M9mwrlXyadOvvlQdJCM6wzRe9LLMoq
         zInst9d28x6oS/nCaXgvGkVSyBlCdUmabxjnrEwM0roHk31QbvJQKAHYp5Vb1LF+9+43
         uHsstkRcn0TGkLXdpfoGYXn07wfaaMkA6ChZ9VDk6/p0Q6/rxf/YwX/J0EsKVY2923xH
         SjKzkVOSggdJ2E2zAhnO3qayEji3z3lZt+ooKbQt8tnevD02OMAaXTMlBQ+m3c5B+LfN
         o+oeLSSVOEeM6D61MfJMKTZfct79FyQFtXvapRkHMt5/L90m+992e4xqbY9OU7ohVfUZ
         4LDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to: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=B0uDimGfmv4icRbFUugMQgdwkVImdrpQdl09MGY4LiM=;
        b=H6j/Og2XAHcGg7U50C5rMBMCIU9Ucv2J5RXNOVbXu8nc59CqLXeSC2ugwDp5zYBecv
         TTca9eRXgK1lRNln+q+z+QmCWbYa2wKzTbBtknWSAnyupDx1VPY5gbWnwXI2NsdfpUnH
         rK4vp1H6rAYjMOIRim84w3CwjToGub6lyr/HJOYvi/QbEFmN4WjeB4vvHhE0G1k03vnW
         uie/pLjyu+dnCY5afdu90pWexa24nwQlzE4PtabmjP20JfZWvcw5F6ym80njiWRGZodH
         7mjZLYbIKTubwEaSv7b9KH0OCbom9huQQSqsaOSIxwDmmwJNND9KpO7yS6untjsTyPUe
         o+7A==
X-Gm-Message-State: AOUpUlGI1cmIVDyNnV/98xPL/HviV0Rd++CkQEziOoOqjrJZ6Ho7reh+
	/8A0vd2jow9GAEHflh9uJlIEbQ==
X-Google-Smtp-Source: AAOMgpfhsl4jkRh6jKKT+9YfkbMv1RsgL+JwEVOtnWoKpVEx3zvb48Zh0NYZwmsFFtMCEYKVYIXeXQ==
X-Received: by 2002:a25:9942:: with SMTP id n2-v6mr6353609ybo.67.1532537036278;
        Wed, 25 Jul 2018 09:43:56 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a81:ec3:: with SMTP id 186-v6ls2375985ywo.33.gmail; Wed, 25
 Jul 2018 09:43:55 -0700 (PDT)
X-Received: by 2002:a0d:de01:: with SMTP id h1-v6mr398057ywe.3.1532537035019;
        Wed, 25 Jul 2018 09:43:55 -0700 (PDT)
In-Reply-To: <edaab808-c155-4369-9be9-e1a0fad36265@isocpp.org>
X-Original-Sender: inkwizytoryankes@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:39400
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39400>

------=_Part_9634_1944432700.1532537034498
Content-Type: multipart/alternative; 
	boundary="----=_Part_9635_11244141.1532537034498"

------=_Part_9635_11244141.1532537034498
Content-Type: text/plain; charset="UTF-8"



On Wednesday, July 25, 2018 at 5:24:19 PM UTC+2, Nicol Bolas wrote:
>
> On Wednesday, July 25, 2018 at 4:14:33 AM UTC-4, Niall Douglas wrote:
>>
>>
>>>>> It's a C proposal; it doesn't interact with `constexpr`. Indeed, one 
>>>>> of its biggest flaws is that it doesn't allow for inter-operation with C++ 
>>>>> static exceptions at all, despite being in part based on the same principle.
>>>>>
>>>>
>>>> My _Fails() proposal does however work in constexpr,
>>>>
>>>
>>> `_Fails()` is not valid C++, and `constexpr` is not valid C. How can 
>>> they work with one another? Unless you're proposing to add `_Fails()` to 
>>> C++, which I think would be a rather hard sell.
>>>
>>
>> I appreciate you are probably not up to date, as I have not issued a new 
>> draft of  D1095 which incorporates the substantial feedback I received from 
>> WG14. And I have only very briefly summarised what will go into that draft 
>> on std-proposals and /r/cpp/.
>>
>> But in short, C22 _Fails(T) maps directly onto C++ 23 throws(T).
>>
>
> Pedantic note: `throws(T)` doesn't exist. `throws(<expr>)` is a 
> *conditional* throws declaration, much like `noexcept(<expr>)`. P0709 
> makes that abundantly clear.
>
> What you're looking for is `throws{T}`. Which P0709 treats as an 
> extension, not a required part of the proposal. So there's no guarantee it 
> will make it into any hypothetical C++23.
>
> The only difference is auto-propagation, so a _Fails(T) if unhandled 
>> results in a failure to compile, whereas a throws(T) if unhandled 
>> propagates upwards.
>>
>> This is what WG14 asked for. As C++ 23 would surely be incorporating C22 
>> into itself, whatever goes into C also goes in C++.
>>
>
> That's not how C++ has worked since 1998. C++11 did not incorporate C99 
> wholesale; it only took specific things from it. Similarly, C++14/17/20 did 
> not adopt C11 wholesale. The two languages are *diverging*.
>
> So why should we expect C++23 to adopt C22 in this way?
>
>  
To make easier to share code between? Image big C22 library that use this 
new calling convention in headers, if we accept this part of C22 using this 
library in C++23 will be trivial. This is too other way around, it allow 
C++ to define headers that will be easy consumable by C and other languages 
that will support C22 exceptions (this is major reason).
 

> I intend to propose, in fact, that both mechanisms work perfectly in 
>> constexpr. It would let constexpr code choose whether failure should be 
>> handled explicitly (_Fails) or implicitly (throws), exactly the same as in 
>> non-constexpr.
>>
>> Niall
>>
>

-- 
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 email 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/61682de8-3bf2-42d4-ae19-fcf3bd1d93a0%40isocpp.org.

------=_Part_9635_11244141.1532537034498
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, July 25, 2018 at 5:24:19 PM UTC+2, N=
icol Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr">On Wednesday, July 25, 2018 at 4:14:33 AM UTC-4, Niall Douglas wrote:<b=
lockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-=
left:1px #ccc solid;padding-left:1ex"><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1e=
x"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0;mar=
gin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
"><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bor=
der-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><br></div><=
div>It&#39;s a C proposal; it doesn&#39;t interact with `constexpr`. Indeed=
, one of its biggest flaws is that it doesn&#39;t allow for inter-operation=
 with C++ static exceptions at all, despite being in part based on the same=
 principle.<br></div></div></blockquote><div><br></div><div>My _Fails() pro=
posal does however work in constexpr,</div></div></blockquote><div><br></di=
v><div>`_Fails()` is not valid C++, and `constexpr` is not valid C. How can=
 they work with one another? Unless you&#39;re proposing to add `_Fails()` =
to C++, which I think would be a rather hard sell.</div></div></blockquote>=
<div><br></div><div>I appreciate you are probably not up to date, as I have=
 not issued a new draft of=C2=A0 D1095 which incorporates the substantial f=
eedback I received from WG14. And I have only very briefly summarised what =
will go into that draft on std-proposals and /r/cpp/.</div><div><br></div><=
div>But in short, C22 _Fails(T) maps directly onto C++ 23 throws(T).</div><=
/blockquote><div><br></div><div>Pedantic note: `throws(T)` doesn&#39;t exis=
t. `throws(&lt;expr&gt;)` is a <i>conditional</i> throws declaration, much =
like `noexcept(&lt;expr&gt;)`. P0709 makes that abundantly clear.</div><div=
><br></div><div>What you&#39;re looking for is `throws{T}`. Which P0709 tre=
ats as an extension, not a required part of the proposal. So there&#39;s no=
 guarantee it will make it into any hypothetical C++23.</div><div><br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div>The only difference is auto-p=
ropagation, so a _Fails(T) if unhandled results in a failure to compile, wh=
ereas a throws(T) if unhandled propagates upwards.</div><div><br></div><div=
>This is what WG14 asked for. As C++ 23 would surely be incorporating C22 i=
nto itself, whatever goes into C also goes in C++.</div></blockquote><div><=
br></div><div>That&#39;s not how C++ has worked since 1998. C++11 did not i=
ncorporate C99 wholesale; it only took specific things from it. Similarly, =
C++14/17/20 did not adopt C11 wholesale. The two languages are <i>diverging=
</i>.<br></div><div><br></div><div>So why should we expect C++23 to adopt C=
22 in this way?<br></div><div><br></div></div></blockquote><div>=C2=A0</div=
><div>To make easier to share code between? Image big C22 library that use =
this new calling convention in headers, if we accept this part of C22 using=
 this library in C++23 will be trivial. This is too other way around, it al=
low C++ to define headers that will be easy consumable by C and other langu=
ages that will support C22 exceptions (this is major reason).<br></div><div=
>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">=
<div></div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:=
0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div>I intend to propose=
, in fact, that both mechanisms work perfectly in constexpr. It would let c=
onstexpr code choose whether failure should be handled explicitly (_Fails) =
or implicitly (throws), exactly the same as in non-constexpr.</div><div><br=
></div><div>Niall</div></blockquote></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/61682de8-3bf2-42d4-ae19-fcf3bd1d93a0%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/61682de8-3bf2-42d4-ae19-fcf3bd1d93a0=
%40isocpp.org</a>.<br />

------=_Part_9635_11244141.1532537034498--

------=_Part_9634_1944432700.1532537034498--

.
