220 33531 <d14636de-fb57-47b3-8666-7976ccdb6fe8@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Barry Revzin <barry.revzin@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Catch block for multiple exceptions
Date: Wed, 2 Aug 2017 05:47:38 -0700 (PDT)
Lines: 97
Approved: news@gmane.org
Message-ID: <d14636de-fb57-47b3-8666-7976ccdb6fe8@isocpp.org>
References: <effe744d-f832-42c7-9b2a-ef31551067d0@isocpp.org> <deaedeb0-a699-49e9-826a-c41e674902c0@isocpp.org> <CAEfefmzCWDwP2ha7UfvvPrW_56TT4DEgvwRyxWm=6gS_GZc7pA@mail.gmail.com>
 <4126837.jZlGhgVnua@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1426_1562684480.1501678058997"
X-Trace: blaine.gmane.org 1501678069 6990 195.159.176.226 (2 Aug 2017 12:47:49 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 2 Aug 2017 12:47:49 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCJJTG7CS4ARB24TQ7GAKGQEHU7RG6A@isocpp.org Wed Aug 02 14:47:45 2017
Return-path: <std-proposals+bncBCJJTG7CS4ARB24TQ7GAKGQEHU7RG6A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f70.google.com ([209.85.214.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCJJTG7CS4ARB24TQ7GAKGQEHU7RG6A@isocpp.org>)
	id 1dct3n-00013g-Ed
	for gclcip-std-proposals@m.gmane.org; Wed, 02 Aug 2017 14:47:35 +0200
Original-Received: by mail-it0-f70.google.com with SMTP id o19sf39723650ito.5
        for <gclcip-std-proposals@m.gmane.org>; Wed, 02 Aug 2017 05:47:41 -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=+IjPP4usLvKrnjw/VzypPfRrMkd1VxxAzoPhJq+/fK0=;
        b=P3kTNRjRa0RGvleGdjYIBK3dmnHoCdoAMvDzqsuPAnsjxgbFRofimtBDRXpJVDwQR+
         rBMmtkWh7KWri5mrym/9vCHaov5vFOC23J1dsrqeZxKnnPa+Aww17b00JaJ176sjqPsp
         soyEDLbS7Nr8rWh+DkKlWB9Cnk4TK1BTrtkVVmsFNudTf9gzhx68Xm0TMasSbllFZhCA
         5neSPbMgo23M7CUkK/DQzLXD8SPw4SCW1oxNgJ3Dy0daB3PlEPyn5pnTfCsT/3WN3irO
         K6BDNhuCPIOd0bgFtYWPFTcspokrbRGVgvzVYE5opfhf/LyiCRmp/07gYOKb67EHjXZj
         x5GQ==
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=+IjPP4usLvKrnjw/VzypPfRrMkd1VxxAzoPhJq+/fK0=;
        b=DE9QE8vIugRZP1Wbp3TYCfoRG2y/COcHVRGZUueSyMgxZ/g2KZaTirNo0SEvSW/P+c
         t1RWMdjwCWL+3a4tSjcxbGmcuhr6fwf1nbZIjGXeMMLih7MJvWYpbSVPUUGxDMKRadRx
         7S5YSNGDoCM7tUuXaAHt40izhiP8QkwAYcRqVUtD10exronMY/AarYbwdBQ+XGSNgpEM
         q5hYwFgFdzgoaZYAwTGvKJvV2fPACHmD6fTee41y5ZrO+E7ZCpLtoxSdaTYCB8DagoKN
         JIMuAM9ujTI4crDUwoNEGqXBzaupQ9i72lrvE5ex4pzA+4Kzu+SFdWvPxPA4Idj3BMHF
         Z10Q==
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=+IjPP4usLvKrnjw/VzypPfRrMkd1VxxAzoPhJq+/fK0=;
        b=MCWOExCvfJjJYF0srqx8R8EEUonPkkbp1LNZGVuV5fxdqg+yb0gAdi6kDSUJenJA7t
         wEaO1F0X7ReUucMGHc6n5O5+XsAEn1ZYs/Tq0waB7WpjVBnN5RbjZ795efJG2Hcb1F9s
         eZYDgywZv555f2L9XSBQpIQ2YTdiHIWqWESHVxP1ohnbnT8s0/SqVsse9TI3okqmBOLH
         70HHew0o4mK7/TP2dzg31Z7BXWmI15mYT1xVEaPoIhwJKQs3VK3Yy7V5s5CDrBQJu0BC
         YoqIxIIizst2UdNVXU1kkC/et70CbrAF5rRTCFqgkYZPOaYJMgM4Uqr7T9haxL97BdbA
         EY+g==
X-Gm-Message-State: AIVw111R5HTXF5qPbZoJRZNvDsDkJg8DEKerI30KkkeSizdPKAvM0LT6
	HIHxxSijjrWWhp3P
X-Received: by 10.107.13.148 with SMTP id 142mr15894241ion.44.1501678061000;
        Wed, 02 Aug 2017 05:47:41 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.21.2 with SMTP id 2ls11991501iov.21.gmail; Wed, 02 Aug
 2017 05:47:39 -0700 (PDT)
X-Received: by 10.31.142.14 with SMTP id q14mr63935vkd.19.1501678059512;
        Wed, 02 Aug 2017 05:47:39 -0700 (PDT)
In-Reply-To: <4126837.jZlGhgVnua@tjmaciei-mobl1>
X-Original-Sender: Barry.Revzin@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:33531
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33531>

------=_Part_1426_1562684480.1501678058997
Content-Type: multipart/alternative; 
	boundary="----=_Part_1427_272495081.1501678058997"

------=_Part_1427_272495081.1501678058997
Content-Type: text/plain; charset="UTF-8"


>
> And how to know which one invoked? You don't. If you wanted to know if it 
> was 
> exceptionA, you'd add a catch block for it.  

 
>

You'd almost want something like:

catch (variant<exceptionA&, exceptionB&, exceptionC&> e) {
    visit([](auto& e){ f(e); }, e);
}

Granted that's a fairly large change to how the catch mechanics currently 
work... 

-- 
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/d14636de-fb57-47b3-8666-7976ccdb6fe8%40isocpp.org.

------=_Part_1427_272495081.1501678058997
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">And how to kn=
ow which one invoked? You don&#39;t. If you wanted to know if it was=20
<br>exceptionA, you&#39;d add a catch block for it. =C2=A0</blockquote><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;">=C2=A0<br></blockquote><div><br></=
div><div>You&#39;d almost want something like:</div><div><br></div><div><di=
v class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); bord=
er-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; word-=
wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subprettyprint=
"><font color=3D"#660066"><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">catch</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify">variant</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify">exceptionA</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">&amp;,</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> exceptionB</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&amp;,</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> exceptionC</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">&amp;&gt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> e</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br>=C2=A0 =C2=A0 visit</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">([](</span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">auto</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> e</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
){</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">e</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">},</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> e</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">);</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</spa=
n></font></div></code></div><br>Granted that&#39;s a fairly large change to=
 how the catch mechanics currently work...=C2=A0</div></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/d14636de-fb57-47b3-8666-7976ccdb6fe8%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/d14636de-fb57-47b3-8666-7976ccdb6fe8=
%40isocpp.org</a>.<br />

------=_Part_1427_272495081.1501678058997--

------=_Part_1426_1562684480.1501678058997--

.
