220 39399 <edaab808-c155-4369-9be9-e1a0fad36265@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@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 08:24:19 -0700 (PDT)
Lines: 136
Approved: news@gmane.org
Message-ID: <edaab808-c155-4369-9be9-e1a0fad36265@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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_9594_1060711400.1532532259209"
X-Trace: blaine.gmane.org 1532532136 526 195.159.176.226 (25 Jul 2018 15:22:16 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 25 Jul 2018 15:22:16 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBJFM4LNAKGQENIFYY6A@isocpp.org Wed Jul 25 17:22:12 2018
Return-path: <std-proposals+bncBCEKFTV6ZUMBBJFM4LNAKGQENIFYY6A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f197.google.com ([209.85.161.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBJFM4LNAKGQENIFYY6A@isocpp.org>)
	id 1fiLcA-0008R1-9j
	for gclcip-std-proposals@m.gmane.org; Wed, 25 Jul 2018 17:22:10 +0200
Original-Received: by mail-yw0-f197.google.com with SMTP id c204-v6sf4379478ywa.8
        for <gclcip-std-proposals@m.gmane.org>; Wed, 25 Jul 2018 08:24:21 -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=+6MPUTEGNCYdSvzRQPey2uUCYN2IKOM3/wQPfhXKHuk=;
        b=OV4xElx0a36uAcfhiNAYS6v4FqjpH44ai6i1cit6JiquT6WW2+XPlgkXdugC0KURc2
         UsdJOJqq8d38mwnugE6KyQhgTebEG97uxQdr/N9mqgJejrq0zDA0T0IjMfU4nQNKfuIb
         /gvksrMBSbyQ+6zivdIcLrrDcA5LCtlhXQ1ABXNAN5WmyIIcTJWhOTd5BCimy0kg4Ni2
         BCEIz/c961Yf+9cL8U41cEGwUJWy7mzkK5BpIfSZnYWDHfbZ4KKm6g90BF1VlMtO+zpl
         plxIusKFhbs9sQQsOcIfikNwqGcgUYl3IjyYQs0eYDHzLIlr4Qe1nKXOkSM5U+tmAuxH
         yhZQ==
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=+6MPUTEGNCYdSvzRQPey2uUCYN2IKOM3/wQPfhXKHuk=;
        b=QFOr5Km5fSgC0W2Xf1/x39xFVbXklLq7X9o5k+sfugvy72KrsPk5rm4X3DtoszSC/+
         7blp8SXyf2HkIt8EJ582uxzQKeBH+4bcMYclkIiF7GHiWZ23h/021YnFGYx6gzDQlwVF
         yFjdoZwSmjvzQNgJiZIg1D0rfGDNC7plib1QSYEE91k51zG1+k8dp/HxfkiLc6sz5yEH
         E4NGtcV47qxmq37ZEEfQWBNpIjM5pGwhn9hvmPTvs8e9joQWKL+hMKG98RWMaafKdUtK
         Sptnk6w5Dbr5T9rhZg1oMHWy0AM9C4iMg9PyVv7nwebvCTP4+jwbY2r7j87CeR4tGOx1
         +VeQ==
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=+6MPUTEGNCYdSvzRQPey2uUCYN2IKOM3/wQPfhXKHuk=;
        b=MdHeztp/ymUZW83kanV0FlF8MU4EpDNPYJ1jCjj2fuHQyRVxjJfvr2GI2i6gLgzFH9
         jrVnJSkW5EcjllP6Vi4xda+5YjvYkaPensLGhswG6LYzBFaa8eFuKW9jTCaT7hG0TrJi
         l5C6/YqqLbOuHM1qn3RXX33RKV0Sn0erRXbzordhrhIkmWswKDt2Jw4fLy8q0rmcDVB9
         Y5Oskc+7jCXbqCKXRebkC6SZS6BY1icbNJDXd0ZyVId7gzHN0n4RfhEvwUJPe5QhaUWX
         yGvvPE6ycdiKmhEAn3c0tJMvTUa2xNSI9STxdxeZQk1YOmitd9cJW2n25AHbP3JcMsJ4
         rbpg==
X-Gm-Message-State: AOUpUlGpk1ZLzVzl6erX0AjjOOZEnSAMYwoCN8B80mBRQGZG3ke/zHIT
	DAFhL/6X6ZBJ5w3ZJirWITvm9w==
X-Google-Smtp-Source: AAOMgpf6uSZEQZzoI8UDXDf/yttI/mCUusQvfuJtZUMybyjZ0e51IcLC0moFTvnW2ho7qIX7wESqYA==
X-Received: by 2002:a25:4e85:: with SMTP id c127-v6mr6382722ybb.32.1532532260886;
        Wed, 25 Jul 2018 08:24:20 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a0d:e6d7:: with SMTP id p206-v6ls2185963ywe.12.gmail; Wed,
 25 Jul 2018 08:24:19 -0700 (PDT)
X-Received: by 2002:a81:330a:: with SMTP id z10-v6mr386679ywz.5.1532532259748;
        Wed, 25 Jul 2018 08:24:19 -0700 (PDT)
In-Reply-To: <ceee4153-dde7-43a3-b43f-aaf62aa01b60@isocpp.org>
X-Original-Sender: jmckesson@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:39399
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39399>

------=_Part_9594_1060711400.1532532259209
Content-Type: multipart/alternative; 
	boundary="----=_Part_9595_461667012.1532532259209"

------=_Part_9595_461667012.1532532259209
Content-Type: text/plain; charset="UTF-8"

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?

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/edaab808-c155-4369-9be9-e1a0fad36265%40isocpp.org.

------=_Part_9595_461667012.1532532259209
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Wednesday, July 25, 2018 at 4:14:33 AM UTC-4, Niall Dou=
glas wrote:<blockquote 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" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin:0;m=
argin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"l=
tr"><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 pa=
rt based on the same principle.<br></div></div></blockquote><div><br></div>=
<div>My _Fails() proposal does however work in constexpr,</div></div></bloc=
kquote><div><br></div><div>`_Fails()` is not valid C++, and `constexpr` is =
not valid C. How can they work with one another? Unless you&#39;re proposin=
g 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 u=
p to date, as I have not issued a new draft of=C2=A0 D1095 which incorporat=
es the substantial feedback I received from WG14. And I have only very brie=
fly 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 exist. `throws(&lt;expr&gt;)` is a <i>conditional</i> throw=
s declaration, much like `noexcept(&lt;expr&gt;)`. P0709 makes that abundan=
tly clear.</div><div><br></div><div>What you&#39;re looking for is `throws{=
T}`. Which P0709 treats as an extension, not a required part of the proposa=
l. 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;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div>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.=
</div><div><br></div><div>This is what WG14 asked for. As C++ 23 would sure=
ly be incorporating C22 into itself, whatever goes into C also goes in C++.=
</div></blockquote><div><br></div><div>That&#39;s not how C++ has worked si=
nce 1998. C++11 did not incorporate C99 wholesale; it only took specific th=
ings from it. Similarly, C++14/17/20 did not adopt C11 wholesale. The two l=
anguages are <i>diverging</i>.<br></div><div><br></div><div>So why should w=
e expect C++23 to adopt C22 in this way?<br></div><div><br></div><blockquot=
e 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 constexpr code ch=
oose whether failure should be handled explicitly (_Fails) or implicitly (t=
hrows), exactly the same as in non-constexpr.</div><div><br></div><div>Nial=
l</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/edaab808-c155-4369-9be9-e1a0fad36265%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/edaab808-c155-4369-9be9-e1a0fad36265=
%40isocpp.org</a>.<br />

------=_Part_9595_461667012.1532532259209--

------=_Part_9594_1060711400.1532532259209--

.
