220 39392 <ceee4153-dde7-43a3-b43f-aaf62aa01b60@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Niall Douglas <nialldouglas14@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 01:14:33 -0700 (PDT)
Lines: 98
Approved: news@gmane.org
Message-ID: <ceee4153-dde7-43a3-b43f-aaf62aa01b60@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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_9700_875305197.1532506473553"
X-Trace: blaine.gmane.org 1532506354 3081 195.159.176.226 (25 Jul 2018 08:12:34 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 25 Jul 2018 08:12:34 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDGKFT5YZADRB2XC4DNAKGQEILXSSAA@isocpp.org Wed Jul 25 10:12:30 2018
Return-path: <std-proposals+bncBDGKFT5YZADRB2XC4DNAKGQEILXSSAA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f198.google.com ([209.85.161.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDGKFT5YZADRB2XC4DNAKGQEILXSSAA@isocpp.org>)
	id 1fiEuL-0000aL-HF
	for gclcip-std-proposals@m.gmane.org; Wed, 25 Jul 2018 10:12:29 +0200
Original-Received: by mail-yw0-f198.google.com with SMTP id p127-v6sf3799819ywg.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 25 Jul 2018 01:14:40 -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=nY91YSSyptYXwKrn9a9c6IlYh4HHRyqA3qXNVDAajL4=;
        b=q2ug2gFAVXxTDIjhbyW31Znkd2DDUM5j3jaY2NRICfFmcyoY9AJg/U0iUWBaGPj48o
         2cZSZ/y7Dq0EzZtnor5UxvlBSqTggJPxeBcGJh98U05mBRdPx0v2uPNnzbCIq2JFodM0
         HDJWy1S5JCm4buNjcWz7/GBX9dh43nLTd3RBYx7E8II0usgnvLSRe9NxbT3A+xlBQQW9
         L/AU44SeVNQfS+obBRK6NPKYYWO03wDPfcLnvT4qicq1pd+3VvyFcr7VZQVB90+UtAli
         pZ55WAz5XgKkcce2HE3WvaXT0fE5zXCd4oSCJ6SxxsG6itOrPVTZovH+atCZWEaePuN/
         gFGg==
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=nY91YSSyptYXwKrn9a9c6IlYh4HHRyqA3qXNVDAajL4=;
        b=XdzCpq0EGATXmiuxcNSFb0yrITvRf6mTiyBqEBUrT0ZJF5LrOmquJFKXl470GalIcs
         J3ZpREoZsr8qbFc4OGcT5+BcEFhDRmGGWOrzRTCf5F79y85Vqw0OVbBEAtZMmEg9RXda
         eEskNyQ9ZLGMSn1cET1GKXFZcRHyQEC0pQxbzLH9Fbu/3fIt1ju+GIF5E03MMuMBWTcc
         kd5q3NJv8i3FXbp2kMHVet2vJvhu8ibntUPT1AOkb8C752LfVOrEjOpiwP3eb8Cgdk6d
         MQCFFZ7D2veoSTHM5Byl2qLJXhlsmgbllCHfNQac7XUg5+S7TaWmAxHXbBPNrM2EsGLF
         CRHw==
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=nY91YSSyptYXwKrn9a9c6IlYh4HHRyqA3qXNVDAajL4=;
        b=GrIm/HrfWu36Jmp01ko/hR0s1XEfpXmGhRAg2pwrTZUGCG3KYcupRcfZ6wQjeDpEaK
         QmNRPuvDmejm6M8X9MS6qHZMiTfRXpAZAbfeVbc24yHBm1hD3qTzJoClCY1r3bZj+u+5
         S+vqnD6BLoWOERtxJw83452L5GkEGDA26rJQhNM38JY79YmO9bYMWHKkcTLVyZCh7XbE
         6FgYDZ2lv2FhEq/CO5TWG78zO6Cr34rLyi6mfIzcJrUD3oF5wqKStnYp8Py/XgXgYSxU
         nvW6avfAzITd6Qmnqjyd0EbUtipddtL5OIqnJiX2xq+dBchBhQvXXdus6co6BHOBlVLn
         k7Ew==
X-Gm-Message-State: AOUpUlEz1E9FirASRpIHfPJEUUamGHaukjlKAh7m1LNezL5k1zJmbwIu
	IvvW8/4TruvvMP7+y3usxH/B5g==
X-Google-Smtp-Source: AAOMgpflp3Ko5Hn4b9lDYEEjfx/yMQDTRODWpXDfSiBYWekAxRJsK5Kv5IccDyoW82S4HXYuq/y53A==
X-Received: by 2002:a0d:e486:: with SMTP id n128-v6mr5943830ywe.217.1532506474945;
        Wed, 25 Jul 2018 01:14:34 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a25:8008:: with SMTP id m8-v6ls3264255ybk.11.gmail; Wed, 25
 Jul 2018 01:14:34 -0700 (PDT)
X-Received: by 2002:a25:8203:: with SMTP id q3-v6mr340927ybk.1.1532506474054;
        Wed, 25 Jul 2018 01:14:34 -0700 (PDT)
In-Reply-To: <363df3db-b747-449f-b95d-81d15b6c3842@isocpp.org>
X-Original-Sender: nialldouglas14@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:39392
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39392>

------=_Part_9700_875305197.1532506473553
Content-Type: multipart/alternative; 
	boundary="----=_Part_9701_448495247.1532506473553"

------=_Part_9701_448495247.1532506473553
Content-Type: text/plain; charset="UTF-8"


>
>
>>> 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). 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++. 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/ceee4153-dde7-43a3-b43f-aaf62aa01b60%40isocpp.org.

------=_Part_9701_448495247.1532506473553
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<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"><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr"><blockquote class=3D"gmail_quot=
e" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div dir=3D"ltr"><div><br></div><div>It&#39;s a C proposal; it doe=
sn&#39;t interact with `constexpr`. Indeed, one of its biggest flaws is tha=
t it doesn&#39;t allow for inter-operation with C++ static exceptions at al=
l, despite being in part based on the same principle.<br></div></div></bloc=
kquote><div><br></div><div>My _Fails() proposal does however work in conste=
xpr,</div></div></blockquote><div><br></div><div>`_Fails()` is not valid C+=
+, and `constexpr` is not valid C. How can they work with one another? Unle=
ss 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 feedback I received from WG14. And=
 I have only very briefly summarised what will go into that draft on std-pr=
oposals and /r/cpp/.</div><div><br></div><div>But in short, C22 _Fails(T) m=
aps directly onto C++ 23 throws(T). The only difference is auto-propagation=
, so a _Fails(T) if unhandled results in a failure to compile, whereas a th=
rows(T) if unhandled propagates upwards.</div><div><br></div><div>This is w=
hat WG14 asked for. As C++ 23 would surely be incorporating C22 into itself=
, whatever goes into C also goes in C++. I intend to propose, in fact, that=
 both mechanisms work perfectly in constexpr. It would let constexpr code c=
hoose whether failure should be handled explicitly (_Fails) or implicitly (=
throws), exactly the same as in non-constexpr.</div><div><br></div><div>Nia=
ll</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/ceee4153-dde7-43a3-b43f-aaf62aa01b60%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ceee4153-dde7-43a3-b43f-aaf62aa01b60=
%40isocpp.org</a>.<br />

------=_Part_9701_448495247.1532506473553--

------=_Part_9700_875305197.1532506473553--

.
