220 33577 <caf74994-b217-4108-80ce-664e64510e34@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: Catch block for multiple exceptions
Date: Thu, 3 Aug 2017 18:25:02 -0700 (PDT)
Lines: 103
Approved: news@gmane.org
Message-ID: <caf74994-b217-4108-80ce-664e64510e34@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> <d14636de-fb57-47b3-8666-7976ccdb6fe8@isocpp.org>
 <d58143f8-c128-3745-b835-1e04a5760d0d@gmail.com> <CA+fGSbMB3=H4hetWu3GFPzUskLP_sh0Q=Q4oxsUsZ6ci-jrpxg@mail.gmail.com>
 <CAFk2RUbdEQMQB4qLCDeaHeF0Q4ntbZG7-Cuf0X2G8d5+Dpf1Pw@mail.gmail.com>
 <54580edb-4a76-4241-b5c8-19ccbc1a562e@isocpp.org> <CAFk2RUZncz91iozp5d=WVhPCHwLa67dhmpwBRMEU5xioJvPuRA@mail.gmail.com>
 <4c872807-7d50-4b58-bbb5-595a8bac1246@isocpp.org>
 <CAFk2RUa2teYd3DAg1VY3xF=vCNKUfna4emTSCYLuUa8dw_UmSg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_291_334164219.1501809902281"
X-Trace: blaine.gmane.org 1501809906 11175 195.159.176.226 (4 Aug 2017 01:25:06 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 4 Aug 2017 01:25:06 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBB3UZR7GAKGQECHHAAKY@isocpp.org Fri Aug 04 03:25:02 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBB3UZR7GAKGQECHHAAKY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-it0-f71.google.com ([209.85.214.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBB3UZR7GAKGQECHHAAKY@isocpp.org>)
	id 1ddRMJ-0002RT-0I
	for gclcip-std-proposals@m.gmane.org; Fri, 04 Aug 2017 03:24:59 +0200
Original-Received: by mail-it0-f71.google.com with SMTP id 7sf3498571ita.0
        for <gclcip-std-proposals@m.gmane.org>; Thu, 03 Aug 2017 18:25:04 -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=2i9yPok07O8ZGzX08YvEeV4xpequPKLWXCkmhAoDrAA=;
        b=ojOYX0GB7P07RCQychvhkFULBPUXPXDmpS0RD5nlIoN5NPPwcXrrZv3RkrgOjJ1vST
         uM+GsvYj9PI6yVT+znPZLOcpKhSZF++Hr2XMA7kJ6rfvhoSDo4ToFnyN3zFLFdj2Y9De
         0WjC/1na3OnSddqMABKs+A4WXoq/lkOKFI0otlQRX8iByNb+YlY2ioVJv0laQf33pEtL
         C2cKqCgtdu2cVSMMYVi+KuLmqwE4Zzc5SObUFUKd2zTobuhcF2BACgnx8F2zMzoXwC/u
         lerSTb8Gb7oyLpjcSUQN5zqYDeuqVzQJNZUSPNYJ/CmoMb4NmbUfAy2Ym6ynywWqYDoX
         T07g==
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=2i9yPok07O8ZGzX08YvEeV4xpequPKLWXCkmhAoDrAA=;
        b=RXoxy2al4mKXL7NbOHqvdGM7Cls+y8JZIlKhpMZzXgHWXtD/fPtEYMwierDwVoi2bd
         UFJunAJzSRUkotfoOXRWedJjg4tQlhK3FDajEjY7slIsUbzG9BrP/8S0jyMb6g7OW1fb
         /LiJShgjBbvJZN/xTJ+R6ltEQNtXppDU5p5m8mIwnW0rU44l3edHAWyQzWd2hmAFfZqd
         kW/J/MUJO4/TZynbh/h8SRNxQ00us167r7QfCwiz7fVKXcQpwiBRqVieq7bKhv9j0Ekf
         ArWETQaJObQnqKEIN2J5G+zQnsg8M2YfemvoqvJtbEF4BW6mDkPCXcMWFGZe4bFFspU8
         D4mA==
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=2i9yPok07O8ZGzX08YvEeV4xpequPKLWXCkmhAoDrAA=;
        b=LAn80sNe4c0eK3cyq99879KgKzEfEtjNaJnhTI3VJFVJWsBoCDa43RldV0FSgbYQU4
         5DOwCfKydYLpfbdPvgWfPWXxUX2HuA/LXOSWOavIJSYvPnU1Hf2M70v+aW+hmKynh3xO
         l5W0ppp4sHUnAlNo0oVFD2sCBohzDGuAhMCgx7l9Xoy37gaEFy9oLgWx1UsZst+WIZoc
         nWyV5Yi7MgLe4O5Letziwr8jJ1qj/TwTHcsCLH0DZksg0GCs5XtJN91tftMoPyQN+AO0
         CI/gmqx94bYJBtx6XPD7v02PWiITx+IJW57VZQHFzqlpOzSsEZwoMKK6CUJ+Hv5KgAjD
         hJCA==
X-Gm-Message-State: AHYfb5gHzh/hJeWyCEEUxCJ01PXB7PkNSG/INC9Mtcblr1lJQ78lJjlN
	8I57Kzx1dMVRQBFv
X-Received: by 10.107.17.165 with SMTP id 37mr554237ior.106.1501809904130;
        Thu, 03 Aug 2017 18:25:04 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.249.129 with SMTP id l123ls755359ith.14.gmail; Thu, 03 Aug
 2017 18:25:02 -0700 (PDT)
X-Received: by 10.31.142.14 with SMTP id q14mr3341vkd.19.1501809902737;
        Thu, 03 Aug 2017 18:25:02 -0700 (PDT)
In-Reply-To: <CAFk2RUa2teYd3DAg1VY3xF=vCNKUfna4emTSCYLuUa8dw_UmSg@mail.gmail.com>
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-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:33577
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33577>

------=_Part_291_334164219.1501809902281
Content-Type: multipart/alternative; 
	boundary="----=_Part_292_1808809100.1501809902282"

------=_Part_292_1808809100.1501809902282
Content-Type: text/plain; charset="UTF-8"



On Thursday, August 3, 2017 at 8:14:00 PM UTC-4, Ville Voutilainen wrote:
>
> On 4 August 2017 at 02:17, Arthur O'Dwyer <arthur....@gmail.com 
> <javascript:>> wrote: 
> >> Note that both of our solutions suffer from the problem that the code 
> >> in the catch-clause 
> >> cannot break, continue, goto or return like plain code could. An 
> >> if-else chain of any_casts 
> >> from exception_ptr would be able to do that. 
> > 
> > 
> > Do you think LEWG would be amenable to a proposal to make std::any_cast 
> an 
> > all-purpose "type-un-erasing" mechanism in C++2a? 
>
> Way to jump the gun. I doubt it, because it doesn't make sense to have 
> one name for 
> different things. However, unerasing the type of an any and an 
> exception_ptr are 
> exactly the same.
>

Not really. The key difference being that `any_cast` typically returns a 
copy of the object, while the exception pointer cast would return a pointer.

It should also be noted that the exception pointer cast needs to be able to 
be cast to the actual exception type or any of its base classes. So if the 
exception derives from `std::exception`, then doing 
`exception_cast<std::exception>` should work. `any_cast` very much does not 
have those semantics.

-- 
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/caf74994-b217-4108-80ce-664e64510e34%40isocpp.org.

------=_Part_292_1808809100.1501809902282
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Thursday, August 3, 2017 at 8:14:00 PM UTC-4, V=
ille Voutilainen wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 4 Au=
gust 2017 at 02:17, Arthur O&#39;Dwyer &lt;<a href=3D"javascript:" target=
=3D"_blank" gdf-obfuscated-mailto=3D"oRFyWc05BgAJ" rel=3D"nofollow" onmouse=
down=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.hre=
f=3D&#39;javascript:&#39;;return true;">arthur....@gmail.com</a>&gt; wrote:
<br>&gt;&gt; Note that both of our solutions suffer from the problem that t=
he code
<br>&gt;&gt; in the catch-clause
<br>&gt;&gt; cannot break, continue, goto or return like plain code could. =
An
<br>&gt;&gt; if-else chain of any_casts
<br>&gt;&gt; from exception_ptr would be able to do that.
<br>&gt;
<br>&gt;
<br>&gt; Do you think LEWG would be amenable to a proposal to make std::any=
_cast an
<br>&gt; all-purpose &quot;type-un-erasing&quot; mechanism in C++2a?
<br>
<br>Way to jump the gun. I doubt it, because it doesn&#39;t make sense to h=
ave
<br>one name for
<br>different things. However, unerasing the type of an any and an exceptio=
n_ptr are
<br>exactly the same.<br></blockquote><div><br>Not really. The key differen=
ce being that `any_cast` typically returns a copy of the object, while the =
exception pointer cast would return a pointer.<br><br>It should also be not=
ed that the exception pointer cast needs to be able to be cast to the actua=
l exception type or any of its base classes. So if the exception derives fr=
om `std::exception`, then doing `exception_cast&lt;std::exception&gt;` shou=
ld work. `any_cast` very much does not have those semantics.</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/caf74994-b217-4108-80ce-664e64510e34%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/caf74994-b217-4108-80ce-664e64510e34=
%40isocpp.org</a>.<br />

------=_Part_292_1808809100.1501809902282--

------=_Part_291_334164219.1501809902281--

.
