220 16116 <56A0729B-434D-4300-B4FF-5D744D81506C@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: deprecate catch exception by value, at least in
 some instances?
Date: Mon, 9 Feb 2015 06:55:38 +0800
Lines: 89
Approved: news@gmane.org
Message-ID: <56A0729B-434D-4300-B4FF-5D744D81506C@gmail.com>
References: <8be36e16-97f4-4d8a-8500-c045195b2f6b@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_0F59AFC3-D707-4A25-9BCD-0A3A41FB36B0"
X-Trace: ger.gmane.org 1423436157 27980 80.91.229.3 (8 Feb 2015 22:55:57 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 8 Feb 2015 22:55:57 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRB5WS36TAKGQEFWKC53Q@isocpp.org Sun Feb 08 23:55:53 2015
Return-path: <std-proposals+bncBCW25A7E3QCRB5WS36TAKGQEFWKC53Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qa0-f70.google.com ([209.85.216.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRB5WS36TAKGQEFWKC53Q@isocpp.org>)
	id 1YKalc-0000iL-Ab
	for gclcip-std-proposals@m.gmane.org; Sun, 08 Feb 2015 23:55:52 +0100
Original-Received: by mail-qa0-f70.google.com with SMTP id v8sf67955641qal.1
        for <gclcip-std-proposals@m.gmane.org>; Sun, 08 Feb 2015 14:55:51 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:content-type:message-id:mime-version
         :subject:date:references:to:in-reply-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=F+23sryJ0Lxo/0B/dQSGPDE4T7MdqcI3DmqcEGSTK28=;
        b=mjaFBK9gZFBOD9vph6pFJoxQWOt5AkAxBSO+GKJ235fx3df2JqOuNWDP0zWHRzHDNm
         hNlCQZEHZ0kqg8q4hbvsuSqrAH3dM/gil94EUEbK5S2XtTUM6M6tPVLWiTj+oCg80foz
         ixjgAjeA2iSHmSJlM7sM0aBdV0/XV2/Sq3SZ4Y0FuyTr1RJIWaMnxKfppuNENe8wvvRs
         GCUFLzYbq4rNSCW2COpINCKIGtTL6E4SxuUUZNf3d5Q+t76mAdhxVZ28aJIiIcdg02d7
         GwVUbTkGT/2hMCCgh8LDm3zNzS+aAdveo9QPQheKg4BLc8AGC0ZPL47/sT/yBItpu3xY
         9Exw==
X-Gm-Message-State: ALoCoQnuqGGyw8wtoP8PsNTBEN2hljcl327My3651j8byVD1qamtu/KOkdp429x08j0YQmuUoSeI
X-Received: by 10.236.24.228 with SMTP id x64mr13284546yhx.26.1423436151451;
        Sun, 08 Feb 2015 14:55:51 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.6.25 with SMTP id 25ls1442178iog.79.gmail; Sun, 08 Feb
 2015 14:55:50 -0800 (PST)
X-Received: by 10.66.55.104 with SMTP id r8mr23151804pap.75.1423436150810;
        Sun, 08 Feb 2015 14:55:50 -0800 (PST)
Original-Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com. [209.85.192.172])
        by mx.google.com with ESMTPS id oz9si19711195pdb.15.2015.02.08.14.55.50
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 08 Feb 2015 14:55:50 -0800 (PST)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 209.85.192.172 as permitted sender) client-ip=209.85.192.172;
Original-Received: by pdjz10 with SMTP id z10so26882982pdj.13
        for <std-proposals@isocpp.org>; Sun, 08 Feb 2015 14:55:50 -0800 (PST)
X-Received: by 10.70.56.6 with SMTP id w6mr23832298pdp.69.1423436150675;
        Sun, 08 Feb 2015 14:55:50 -0800 (PST)
Original-Received: from [172.20.10.2] ([121.54.44.93])
        by mx.google.com with ESMTPSA id ew7sm14332161pdb.65.2015.02.08.14.55.48
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 08 Feb 2015 14:55:50 -0800 (PST)
In-Reply-To: <8be36e16-97f4-4d8a-8500-c045195b2f6b@isocpp.org>
X-Mailer: Apple Mail (2.2070.6)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 209.85.192.172 as permitted sender)
 smtp.mail=potswa@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:16116
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/16116>

--Apple-Mail=_0F59AFC3-D707-4A25-9BCD-0A3A41FB36B0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9302=E2=80=9309, at 6:42 AM, gmisocpp@gmail.com wrote:
>=20
> A more graphic example  note my_base destructs twice but constructs once:

You=E2=80=99re not seeing the copy (by slice) constructor.

If you don=E2=80=99t want a base exception class to be sliced, you can cons=
ider making it abstract. I don=E2=80=99t really see any problem in getting =
a std::exception value, though.

On the other hand, catching a base class by value gives the catch block its=
 own modifiable copy. This might not be very useful, and might seldom refle=
ct a strong intent of the programmer, but there=E2=80=99s no other way to a=
chieve it than to initialize the parameter by value. Deprecation would seem=
 gratuitous.

> Again no warning. Would anyone ever want this in this circumstance?

I=E2=80=99ve never really wanted a catch by value, but it does give the blo=
ck the opportunity to choose between throwing a modified copy, and re-throw=
ing to resume unwinding without any change.

--=20

---=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_0F59AFC3-D707-4A25-9BCD-0A3A41FB36B0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9302=
=E2=80=9309, at 6:42 AM, <a href=3D"mailto:gmisocpp@gmail.com" class=3D"">g=
misocpp@gmail.com</a> wrote:</div><br class=3D"Apple-interchange-newline"><=
div class=3D""><div style=3D"font-family: Helvetica; font-size: 12px; font-=
style: normal; font-variant: normal; font-weight: normal; letter-spacing: n=
ormal; line-height: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; word-spacing:=
 0px; -webkit-text-stroke-width: 0px;" class=3D"">A more graphic example&nb=
sp; note my_base destructs twice but constructs once:</div></div></blockquo=
te></div><br class=3D""><div class=3D"">You=E2=80=99re not seeing the copy =
(by slice) constructor.</div><div class=3D""><br class=3D""></div><div clas=
s=3D"">If you don=E2=80=99t want a base exception class to be sliced, you c=
an consider making it abstract. I don=E2=80=99t really see any problem in g=
etting a <font face=3D"Courier" class=3D"">std::exception</font> value, tho=
ugh.</div><div class=3D""><br class=3D""></div><div class=3D"">On the other=
 hand, catching a base class by value gives the catch block its own modifia=
ble copy. This might not be very useful, and might seldom reflect a strong =
intent of the programmer, but there=E2=80=99s no other way to achieve it th=
an to initialize the parameter by value. Deprecation would seem gratuitous.=
</div><div class=3D""><br class=3D""></div><div class=3D""><blockquote type=
=3D"cite" class=3D""><div class=3D"">Again no warning. Would anyone ever wa=
nt this in this circumstance?</div></blockquote><br class=3D""></div><div c=
lass=3D"">I=E2=80=99ve never really wanted a catch by value, but it does gi=
ve the block the opportunity to choose between throwing a modified copy, an=
d re-throwing to resume unwinding without any change.</div></body></html>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_0F59AFC3-D707-4A25-9BCD-0A3A41FB36B0--

.
