220 33574 <CAFk2RUa2teYd3DAg1VY3xF=vCNKUfna4emTSCYLuUa8dw_UmSg@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Catch block for multiple exceptions
Date: Fri, 4 Aug 2017 03:13:57 +0300
Lines: 49
Approved: news@gmane.org
Message-ID: <CAFk2RUa2teYd3DAg1VY3xF=vCNKUfna4emTSCYLuUa8dw_UmSg@mail.gmail.com>
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>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1501805642 15337 195.159.176.226 (4 Aug 2017 00:14:02 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 4 Aug 2017 00:14:02 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5JHI7A7ALRBR7YR3GAKGQEZ3X3WFQ@isocpp.org Fri Aug 04 02:13:58 2017
Return-path: <std-proposals+bncBC5JHI7A7ALRBR7YR3GAKGQEZ3X3WFQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f200.google.com ([209.85.220.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBR7YR3GAKGQEZ3X3WFQ@isocpp.org>)
	id 1ddQFW-0003bq-2o
	for gclcip-std-proposals@m.gmane.org; Fri, 04 Aug 2017 02:13:54 +0200
Original-Received: by mail-qk0-f200.google.com with SMTP id s18sf1300320qks.4
        for <gclcip-std-proposals@m.gmane.org>; Thu, 03 Aug 2017 17:14:00 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1501805640; cv=pass;
        d=google.com; s=arc-20160816;
        b=R74iqJcmnU7zw7uEu2Okf2bVp0CIpH7wlUdMboGd9DC8Rl3RzzwOExiFAmmN3wxGMl
         unTOUKxVZ100wabFPbjQwEUneAJUiTIdJoBxr2gtb8W23ZsqiX3QIpf/iC+ZyOQVSnI2
         8UhoLmpN3RdhjI1CWpqKHRTLSr6amV/4qHNdjxdj9Vnsvv8kEp7+hhZlzLufooAwLTRF
         erxyYPeuUm3GzkqiGAChmIOdcJ7z4rSgFQb9gSbf5fgFkvfPFXSJ8mtaoqxRTLuxblMy
         iblzqL7L8kXIMU4Uwa8+c2tTCFJpLSvvtLWTdLq7mFJa6codXbDT0uP3XZJDjpmYQrgY
         bTDQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=DzY/E3bzfy6tdiFOdl89l9nsM93H/r8EE2TfbfRnPyQ=;
        b=lZeETFGE/8m7cvMaznR57ErxLtGlIG7EiY9KJaKWJNrA9SqfYbu5hNdr2OtQ602+Zk
         gtuFR5XVWJMqxTzvw8YAuaTI0v0SV4/cGcR82/0CEosS0pM99uIua4VajcrAvn4ANYoZ
         so4rHWZH/4EgIco/bzEudE6aEk2VFGr+XVNnk5IAtRZX7yRwB+4BKpRS9zAV7LYf7z7E
         f3Aie5xl8EWBGs4P8rzoiYYvRIVozV8/rrUyzG8y3kvzCjBNfNGDaMtTnGEKLoe9xBUD
         xUHUdoBFrHxYDz4NxJgYUmvSRuZkdrHO6F/qPbV/43k8MgO90dPbdxf/m9ddbO/oWnBB
         Iq9A==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=rnWVaWiv;
       spf=pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400c:c05::244 as permitted sender) smtp.mailfrom=ville.voutilainen@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=DzY/E3bzfy6tdiFOdl89l9nsM93H/r8EE2TfbfRnPyQ=;
        b=buMv29Bz5EL8hTrBzFBv6cBbcw5PRN/QP0Wq0g6CDBPDkcb0pB+GhWuX6sDO4EiPIx
         ZaC3mPuQiL7J887nmp2Am7riH1fLm8f8zMcjSln9M2Gtx2mnHvyyDTke0mza1Jwkllpc
         JMAMNJQJJNJg1NHcc58K0GqDpUi3gk8ya7zC0Yyh4rJufKtSQIPSMDRjerUeZa9oevgT
         JYf7kvSi5R8ACIg7wF4kWtui4qRwhTIVa6IKJUv7CqN/bwzrsIVkNroX0Mt1Dyl7hNid
         sW4rpcDKCRROAtHV219FTGxZbG2bju1t5BjfKOp3X0wdoYQPO8V/iyl4Zo0GLAGuNpFO
         bkYg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=DzY/E3bzfy6tdiFOdl89l9nsM93H/r8EE2TfbfRnPyQ=;
        b=HJYjqAZ7E/9VGkNhSY7N4FxajANApEKBOeCsYPx445qcbA9K+fCrV6CvwIJQ+NXiwR
         GJtyB5vDmIJ0LuW9rNvWcsujvk285ALMDG+u+0pxydyg8UesvuxyioE2iew7jx/3pi70
         Vb65oIxX4ovDX5G4lnh3J3SIEXnJ47DJx7vQqj5OK0VJUGMcKMjdAmf7q7ZBc/k1BJeE
         qPHnItBIjGdzlu8u8O1kPtaJpT8T6JCWcZ91Z2rb7sJ3sMqHB/M5ibp5uHi+ykCrS2zi
         p3sNHpdg3oEwu7FBz/DMS1f7FieRMziaTlopCbJS80CYMjUPCrD+SQ8LpcPStapR48yz
         MySA==
X-Gm-Message-State: AHYfb5gEkYQOg7ZyoAb1AYMbgEzvAKl+jzjfJUa29RskPwETa5UIo0f6
	axNgdeVVHB14vx7x
X-Received: by 10.200.54.89 with SMTP id n25mr442384qtb.45.1501805640102;
        Thu, 03 Aug 2017 17:14:00 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.36.138.65 with SMTP id v62ls573517itd.3.canary-gmail; Thu, 03
 Aug 2017 17:13:58 -0700 (PDT)
X-Received: by 10.31.197.133 with SMTP id v127mr384865vkf.12.1501805638861;
        Thu, 03 Aug 2017 17:13:58 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1501805638; cv=none;
        d=google.com; s=arc-20160816;
        b=l6t8qWSpjdbPxT26K/gePvau8WMka6spWqqO8Lk0Qi/zO1snW7Gcsu8TPckirEuf1j
         HlaA835eAIer0ymMLdjatHVlU/K94J3zjWDkSnAjHcuxyLRrulZAApgAEvLH8OfrLwjX
         p7bMpAXeuqll3hV4g2nKFmX5JPqFjbFdklsE06c1IqeqrRzKmopIoLzr8AKMmKkXXKtR
         eRygQ93iE+cAgTGd10uC+edTzH8/ALV0nDdbI+E029sv6pQG3ylS0AxlqteGD7oNlP93
         Fv8a8QMzLU+dEjPIZzXuw7wuUM9kzqipwg8pCa/HxptOe8CaKY57O209QtBPyQHm9P14
         CHjw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=G5pZG9fCckNW0Qn+ETXWwUnaQLh78SHZlVuXsLBkTW8=;
        b=WZPmw6lDAte6uUWSKaYK66ky9AKFP7fvyLiJKwX/8KmmbYc0zoVNuQ/lurmN9gVANW
         ZY5b/3GjVXQxB77V/t1BwEt+45jem9xQQ2X3qs4MtZl/yMy2B94rzdo8G6k5YH0Tvumg
         0PHEDljhMXB98PAwf7Rrh3JyDFW/53MCAwRMaTliiT6PFfOn83263Lao1+2BU73Qehuz
         9BPp2xCtZEolB2B75rMOWfed7rCYW8w+Kavzq/sVNgc2aXVhd3L6+shfY0M8OwhkUWle
         mzDB9Y71FxIVU2WeSD3YqC+GOVkj8YRpPXiukUMU110fRyWvxci51uXZU1j70PE0zuc9
         NKKQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.b=rnWVaWiv;
       spf=pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400c:c05::244 as permitted sender) smtp.mailfrom=ville.voutilainen@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-vk0-x244.google.com (mail-vk0-x244.google.com. [2607:f8b0:400c:c05::244])
        by mx.google.com with ESMTPS id v81si115154vke.343.2017.08.03.17.13.58
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 03 Aug 2017 17:13:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400c:c05::244 as permitted sender) client-ip=2607:f8b0:400c:c05::244;
Original-Received: by mail-vk0-x244.google.com with SMTP id d124so109782vkf.1
        for <std-proposals@isocpp.org>; Thu, 03 Aug 2017 17:13:58 -0700 (PDT)
X-Received: by 10.31.238.195 with SMTP id m186mr375604vkh.116.1501805638395;
 Thu, 03 Aug 2017 17:13:58 -0700 (PDT)
Original-Received: by 10.103.103.65 with HTTP; Thu, 3 Aug 2017 17:13:57 -0700 (PDT)
In-Reply-To: <4c872807-7d50-4b58-bbb5-595a8bac1246@isocpp.org>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.b=rnWVaWiv;       spf=pass (google.com: domain of
 ville.voutilainen@gmail.com designates 2607:f8b0:400c:c05::244 as permitted
 sender) smtp.mailfrom=ville.voutilainen@gmail.com;       dmarc=pass (p=NONE
 sp=NONE dis=NONE) header.from=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:33574
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33574>

On 4 August 2017 at 02:17, Arthur O'Dwyer <arthur.j.odwyer@gmail.com> 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.

> Right now we have a different type-un-erasure mechanism for each type-erased
> type, and more proliferating with each revision of the Standard:
>
> std::any a = xx;
> assert( std::any_cast<Type>(a) == 42 );
>
> std::function<long()> f = xx;
> assert( *f.target<Type>() == xx );
>
> std::shared_ptr<int> p(new int, xx);
> assert( *std::get_deleter<Type>(p) == xx );
>
> (from
> https://stackoverflow.com/questions/44788017/retrieve-typeid-of-shared-ptr-deleter)
> (and from this thread, we can add std::exception_ptr to the list of
> type-erased types)
>
> I'm not sure "any_cast" would necessarily be the right spelling, but it is
> pretty awkward IMHO that various library designers keep reinventing it over
> and over with different spellings.

Well, I suppose we could have an unerase(), if you can find enough
common functionality,
but if you want to make it fully generic, it needs to become a
customization point and oh
what fun that will be.

-- 
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/CAFk2RUa2teYd3DAg1VY3xF%3DvCNKUfna4emTSCYLuUa8dw_UmSg%40mail.gmail.com.

.
