Topic: exception classes
Author: Kristen Wegner <kristen.wegner@gmail.com>
Date: Wed, 20 Feb 2019 10:28:38 -0800 (PST)
Raw View
------=_Part_63_2021104249.1550687318711
Content-Type: multipart/alternative;
boundary="----=_Part_64_400953254.1550687318711"
------=_Part_64_400953254.1550687318711
Content-Type: text/plain; charset="UTF-8"
Hi. This is my first post here after lurking a while, so forgive me if I am
barking up the wrong tree.
I am contemplating how exceptions are represented, and whether they might
be improved somehow. Exceptions are currently just structs or classes like
any other, yet they are used quite differently.
What if we had smarter "exception classes" that had a few specialized
facilities for doing the things that exceptions need to do? We have "enum
class," how about "exception class?" For example:
#ifndef _EXCEPTION_CLASSES
#define exception
#endif
exception class my_exception // 'exception class' gives us permission to
override catch.
{
public:
my_exception(const std::string& message, int thing) : message_(message),
thing_(thing) { }
void complain() const {
std::cerr << "Caught '" << typeid(*this).name() << "': " << message_ << ",
thing was: " << thing_ << std::endl;
}
#ifdef _EXCEPTION_CLASSES
// Here we handle being caught.
my_exception& operator catch() {
complain();
return *this;
}
#endif
private:
std::string message_;
int thing_;
};
Now, when I do something like:
int dummy(int thing)
{
try
{
if (!thing) throw my_exception("Dummy: Bad thing", thing);
}
catch(my_exception& e) // my_exception::operator catch() gets called.
{
#ifndef _EXCEPTION_CLASSES
e.complain(); // Not needed with exception classes.
#endif
}
}
.... I automatically get called when my exception class is caught. Presto, I
can override operator catch() in all of my exceptions and enable automatic
tracing.
Are there any more ideas out there how to improve exceptions?
--
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/518a0db5-b7f2-470f-b0be-606f66f1c786%40isocpp.org.
------=_Part_64_400953254.1550687318711
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi. This is my first post here after lurking a while, so f=
orgive me if I am barking up the wrong tree.<div><br></div><div>I am contem=
plating how exceptions are represented, and whether they might be improved =
somehow. Exceptions are currently just structs or classes like any other, y=
et they are used quite differently.</div><div><br></div><div>What if we had=
smarter "exception classes" that had a few specialized facilitie=
s for doing the things that exceptions need to do? We have "<font face=
=3D"courier new, monospace">enum class</font>," how about "<font =
face=3D"courier new, monospace">exception class</font>?" For example:<=
/div><div><br></div><div><span style=3D"color: rgb(153, 0, 0); font-family:=
"courier new", monospace;">#ifndef _EXCEPTION_CLASSES</span><br>=
</div><div><font color=3D"#990000"><span style=3D"font-family: "courie=
r new", monospace;">#define=C2=A0</span><span style=3D"font-family: &q=
uot;courier new", monospace;">exception</span><span style=3D"font-fami=
ly: "courier new", monospace;">=C2=A0</span></font></div><div><sp=
an style=3D"color: rgb(153, 0, 0); font-family: "courier new", mo=
nospace;">#endif</span><span style=3D"color: rgb(153, 0, 0); font-family: &=
quot;courier new", monospace;"><br></span></div><div><span style=3D"co=
lor: rgb(153, 0, 0); font-family: "courier new", monospace;"><br>=
</span></div><div><div><font face=3D"courier new, monospace"><font color=3D=
"#0000ff">exception class</font> my_exception=C2=A0</font><span style=3D"co=
lor: rgb(56, 118, 29); font-family: "courier new", monospace;">//=
</span><span style=3D"color: rgb(56, 118, 29); font-family: "courier n=
ew", monospace;">=C2=A0</span><font color=3D"#38761d"><span style=3D"f=
ont-family: "courier new", monospace;">'</span><span style=3D=
"font-family: "courier new", monospace;">exception</span><span st=
yle=3D"font-family: "courier new", monospace;">=C2=A0class' g=
</span><span style=3D"font-family: "courier new", monospace;">iv<=
/span></font><span style=3D"color: rgb(56, 118, 29); font-family: "cou=
rier new", monospace;">es us permission to override catch.</span></div=
><div><font face=3D"courier new, monospace">{</font></div><div><font face=
=3D"courier new, monospace"><font color=3D"#0000ff">public</font>:</font></=
div><div><font face=3D"courier new, monospace"><span style=3D"white-space:p=
re"> </span>my_exception(<font color=3D"#0000ff">const </font>std::string&a=
mp; message, <font color=3D"#0000ff">int </font>thing) : message_(message),=
thing_(thing) { }</font></div><div><span style=3D"font-family: "couri=
er new", monospace; white-space: pre;"> </span><span style=3D"font-fam=
ily: "courier new", monospace;"><font color=3D"#0000ff">void </fo=
nt>complain() <font color=3D"#0000ff">const </font>{</span><br></div><div><=
font face=3D"courier new, monospace"><div><span style=3D"white-space:pre"> =
</span>std::cerr << "Caught '" << typeid(*this).=
name() << "': " << message_ << ", thin=
g was: " << thing_ << std::endl;</div><div><span style=3D"=
white-space:pre"> </span>}</div><div><font color=3D"#990000">#ifdef _EXCEPT=
ION_CLASSES</font></div></font></div><div><font face=3D"courier new, monosp=
ace"><span style=3D"white-space:pre"> </span><font color=3D"#38761d">// Her=
e we handle being caught.</font></font></div><div><font face=3D"courier new=
, monospace"><span style=3D"white-space:pre"> </span>my_exception& <fon=
t color=3D"#0000ff">operator catch</font>() {</font></div><div><font face=
=3D"courier new, monospace"><span style=3D"white-space:pre"> </span>compla=
in()</font><span style=3D"font-family: "courier new", monospace;"=
>;</span></div><div><font face=3D"courier new, monospace"><span style=3D"wh=
ite-space:pre"> </span><font color=3D"#0000ff">return </font>*this;<br></f=
ont></div><div><font face=3D"courier new, monospace"><span style=3D"white-s=
pace:pre"> </span>}</font></div><div><font face=3D"courier new, monospace" =
color=3D"#990000">#endif</font></div><div><font face=3D"courier new, monosp=
ace"><font color=3D"#0000ff">private</font>:</font></div><div><font face=3D=
"courier new, monospace"><span style=3D"white-space:pre"> </span>std::strin=
g message_;</font></div><div><font face=3D"courier new, monospace"><span st=
yle=3D"white-space:pre"> </span><font color=3D"#0000ff">int </font>thing_;<=
/font></div><div><font face=3D"courier new, monospace">};</font></div></div=
><div><br></div><div>Now, when I do something like:</div><div><br></div><di=
v><div><font face=3D"courier new, monospace"><font color=3D"#0000ff">int </=
font>dummy(<font color=3D"#0000ff">int </font>thing)</font></div><div><font=
face=3D"courier new, monospace">{</font></div><div><font face=3D"courier n=
ew, monospace"><span style=3D"white-space:pre"> </span><font color=3D"#0000=
ff">try</font></font></div><div><font face=3D"courier new, monospace"><span=
style=3D"white-space:pre"> </span>{</font></div><div><font face=3D"courier=
new, monospace"><span style=3D"white-space:pre"> </span><font color=3D"#0=
000ff">if </font>(!thing) <font color=3D"#0000ff">throw </font>my_exception=
("Dummy: Bad thing", thing);</font></div><div><font face=3D"couri=
er new, monospace"><span style=3D"white-space:pre"> </span>}</font></div><d=
iv><font face=3D"courier new, monospace"><span style=3D"white-space:pre"> <=
/span><font color=3D"#0000ff">catch</font>(my_exception& e) <font color=
=3D"#38761d">// my_exception::operator catch() gets called.</font></font></=
div><div><font face=3D"courier new, monospace"><span style=3D"white-space:p=
re"> </span>{</font></div><div><span style=3D"color: rgb(153, 0, 0); font-f=
amily: "courier new", monospace;">#ifndef _EXCEPTION_CLASSES</spa=
n><font face=3D"courier new, monospace"><br></font></div><div><font face=3D=
"courier new, monospace"><span style=3D"white-space:pre"> </span>e.complai=
n(); <font color=3D"#38761d">// Not needed with exception classes.</font></=
font></div><div><span style=3D"color: rgb(153, 0, 0); font-family: "co=
urier new", monospace;">#endif</span><font face=3D"courier new, monosp=
ace"><br></font></div><div><font face=3D"courier new, monospace"><span styl=
e=3D"white-space:pre"> </span>}</font></div><div><font face=3D"courier new,=
monospace">}</font></div><div>=C2=A0</div></div><div>... I automatically g=
et called when my exception class is caught. Presto, I can override <font f=
ace=3D"courier new, monospace">operator catch()</font> in all of my excepti=
ons and enable automatic tracing.</div><div><br></div><div>Are there any mo=
re ideas out there how to improve exceptions?</div><div><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/518a0db5-b7f2-470f-b0be-606f66f1c786%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/518a0db5-b7f2-470f-b0be-606f66f1c786=
%40isocpp.org</a>.<br />
------=_Part_64_400953254.1550687318711--
------=_Part_63_2021104249.1550687318711--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Wed, 20 Feb 2019 10:39:17 -0800 (PST)
Raw View
------=_Part_71_1849031886.1550687957274
Content-Type: multipart/alternative;
boundary="----=_Part_72_1698679111.1550687957274"
------=_Part_72_1698679111.1550687957274
Content-Type: text/plain; charset="UTF-8"
I'm unsure how this particularly improves anything. What exactly is this
`operator catch` supposed to do? What does it return? Why do you need such
a thing? If `complain` is something that needs to happen anytime such an
exception is thrown, wouldn't it make more sense to call `complain` in the
exception's constructor, when the call stack is available, rather than at
`catch` time when unwinding is complete and the source is unknown?
Equally importantly, it would be the very great hope of a (large?) number
of C++ programmers that such exceptions go the way of the Dodo. To be
replaced, not by a more complex and flexible exception system, but by a simpler
and more rigid system <https://wg21.link/P0709>. Why add features that only
matter for dynamic exceptions, if the idea is to move *away* from dynamic
exceptions?
--
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/5e1b6861-ca83-4d2a-88a9-470a9d72eb7f%40isocpp.org.
------=_Part_72_1698679111.1550687957274
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I'm unsure how this particularly improves anythin=
g. What exactly is this `operator catch` supposed to do? What does it retur=
n? Why do you need such a thing? If `complain` is something that needs to h=
appen anytime such an exception is thrown, wouldn't it make more sense =
to call `complain` in the exception's constructor, when the call stack =
is available, rather than at `catch` time when unwinding is complete and th=
e source is unknown?<br></div><div><br></div><div>Equally importantly, it w=
ould be the very great hope of a (large?) number of C++ programmers that su=
ch exceptions go the way of the Dodo. To be replaced, not by a more complex=
and flexible exception system, but by a <a href=3D"https://wg21.link/P0709=
">simpler and more rigid system</a>. Why add features that only matter for =
dynamic exceptions, if the idea is to move <i>away</i> from dynamic excepti=
ons?<br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/5e1b6861-ca83-4d2a-88a9-470a9d72eb7f%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5e1b6861-ca83-4d2a-88a9-470a9d72eb7f=
%40isocpp.org</a>.<br />
------=_Part_72_1698679111.1550687957274--
------=_Part_71_1849031886.1550687957274--
.
Author: Victor Dyachenko <victor.dyachenko@gmail.com>
Date: Wed, 20 Feb 2019 22:21:07 -0800 (PST)
Raw View
------=_Part_248_364784930.1550730067658
Content-Type: multipart/alternative;
boundary="----=_Part_249_1658366193.1550730067658"
------=_Part_249_1658366193.1550730067658
Content-Type: text/plain; charset="UTF-8"
On Wednesday, February 20, 2019 at 9:28:38 PM UTC+3, Kristen Wegner wrote:
>
> Exceptions are currently just structs or classes
>
Wrong. Any copyable type can be an exception.
throw 1; // legal C++, int exception
--
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/007d83b7-dcc6-4c15-8688-d5704074a6f1%40isocpp.org.
------=_Part_249_1658366193.1550730067658
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Wednesday, February 20, 2019 at 9:28:38 PM UTC+3, Krist=
en Wegner wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r">Exceptions are currently just structs or classes<br></div></blockquote><=
div><br></div><div>Wrong. Any copyable type can be an exception.</div><div>=
<br></div><div><span style=3D"font-family: courier new, monospace;">throw 1=
; // legal C++, int exception</span><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/007d83b7-dcc6-4c15-8688-d5704074a6f1%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/007d83b7-dcc6-4c15-8688-d5704074a6f1=
%40isocpp.org</a>.<br />
------=_Part_249_1658366193.1550730067658--
------=_Part_248_364784930.1550730067658--
.
Author: Kristen Wegner <kristen.wegner@gmail.com>
Date: Thu, 21 Feb 2019 06:11:26 -0800 (PST)
Raw View
------=_Part_470_646670411.1550758286166
Content-Type: multipart/alternative;
boundary="----=_Part_471_1135443101.1550758286167"
------=_Part_471_1135443101.1550758286167
Content-Type: text/plain; charset="UTF-8"
I was suggesting that "catch" would be called when an exception is caught.
Types used as exceptions currently only know when they are created or
destroyed, not thrown or caught. If we could think of "throw" and "catch"
as operators on some type, then it might be nice to have them overloadable
for that type.
I agree that exceptions should go away, and be replaced by a simpler and
more rigid system <https://wg21.link/P0709>, as you mention (which is
beautiful BTW). I prefer to not use them myself, but there is unfortunately
quite a lot of code out there that still uses them (that some of us suffer
under).
On Wednesday, February 20, 2019 at 1:39:17 PM UTC-5, Nicol Bolas wrote:
>
> I'm unsure how this particularly improves anything. What exactly is this
> `operator catch` supposed to do? What does it return? Why do you need such
> a thing? If `complain` is something that needs to happen anytime such an
> exception is thrown, wouldn't it make more sense to call `complain` in the
> exception's constructor, when the call stack is available, rather than at
> `catch` time when unwinding is complete and the source is unknown?
>
> Equally importantly, it would be the very great hope of a (large?) number
> of C++ programmers that such exceptions go the way of the Dodo. To be
> replaced, not by a more complex and flexible exception system, but by a simpler
> and more rigid system <https://wg21.link/P0709>. Why add features that
> only matter for dynamic exceptions, if the idea is to move *away* from
> dynamic exceptions?
>
--
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/078ca0a4-cf85-4fac-a7ac-c10f57b656b5%40isocpp.org.
------=_Part_471_1135443101.1550758286167
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I was suggesting that "catch" would be called wh=
en an exception is caught. Types used as exceptions currently only know whe=
n they are created or destroyed, not thrown or caught. If we could think of=
"throw" and "catch" as operators on some type, then it=
might be nice to have them overloadable for that type.<div><br></div><div>=
I agree that exceptions should go away, and be replaced by a=C2=A0<a href=
=3D"https://wg21.link/P0709" target=3D"_blank" rel=3D"nofollow">simpler and=
more rigid system</a>,=C2=A0as you mention (which is beautiful BTW). I pre=
fer to not use them myself, but there is unfortunately quite a lot of code =
out there that still uses them (that some of us suffer under).<br><br>On We=
dnesday, February 20, 2019 at 1:39:17 PM UTC-5, Nicol Bolas wrote:<blockquo=
te class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left:=
1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>I'm unsure ho=
w this particularly improves anything. What exactly is this `operator catch=
` supposed to do? What does it return? Why do you need such a thing? If `co=
mplain` is something that needs to happen anytime such an exception is thro=
wn, wouldn't it make more sense to call `complain` in the exception'=
;s constructor, when the call stack is available, rather than at `catch` ti=
me when unwinding is complete and the source is unknown?<br></div><div><br>=
</div><div>Equally importantly, it would be the very great hope of a (large=
?) number of C++ programmers that such exceptions go the way of the Dodo. T=
o be replaced, not by a more complex and flexible exception system, but by =
a <a href=3D"https://wg21.link/P0709" target=3D"_blank" rel=3D"nofollow" on=
mousedown=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2=
Fwg21.link%2FP0709\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEubB_ZwRXmJ4YH27=
grEDvb0uEiXQ';return true;" onclick=3D"this.href=3D'https://www.goo=
gle.com/url?q\x3dhttps%3A%2F%2Fwg21.link%2FP0709\x26sa\x3dD\x26sntz\x3d1\x2=
6usg\x3dAFQjCNEubB_ZwRXmJ4YH27grEDvb0uEiXQ';return true;">simpler and m=
ore rigid system</a>. Why add features that only matter for dynamic excepti=
ons, if the idea is to move <i>away</i> from dynamic exceptions?<br></div><=
/div></blockquote></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/078ca0a4-cf85-4fac-a7ac-c10f57b656b5%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/078ca0a4-cf85-4fac-a7ac-c10f57b656b5=
%40isocpp.org</a>.<br />
------=_Part_471_1135443101.1550758286167--
------=_Part_470_646670411.1550758286166--
.
Author: Erich Keane <erich.keane@verizon.net>
Date: Thu, 21 Feb 2019 17:03:59 -0800 (PST)
Raw View
------=_Part_826_160360712.1550797440022
Content-Type: multipart/alternative;
boundary="----=_Part_827_2051713010.1550797440022"
------=_Part_827_2051713010.1550797440022
Content-Type: text/plain; charset="UTF-8"
On Wednesday, February 20, 2019 at 8:21:07 PM UTC-10, Victor Dyachenko
wrote:
>
> On Wednesday, February 20, 2019 at 9:28:38 PM UTC+3, Kristen Wegner wrote:
>>
>> Exceptions are currently just structs or classes
>>
>
> Wrong. Any copyable type can be an exception.
>
> throw 1; // legal C++, int exception
>
Almost:
http://eel.is/c++draft/except.throw#3
If the type of the exception object would be an incomplete type, an
abstract class type ([class.abstract]
<http://eel.is/c++draft/class.abstract>), or a pointer to an incomplete
type other than cv void the program is ill-formed.
<http://eel.is/c++draft/except.throw#3.sentence-3>
Pointers to incomplete types are copyable but not throwable.
--
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/a8b7e511-ee61-4da1-85ed-d3e01895b84a%40isocpp.org.
------=_Part_827_2051713010.1550797440022
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Wednesday, February 20, 2019 at 8:21:07 PM UTC-=
10, Victor Dyachenko wrote:<blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr">On Wednesday, February 20, 2019 at 9:28:38 PM UTC+3, Kristen =
Wegner wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-lef=
t:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">Excep=
tions are currently just structs or classes<br></div></blockquote><div><br>=
</div><div>Wrong. Any copyable type can be an exception.</div><div><br></di=
v><div><span style=3D"font-family:courier new,monospace">throw 1; // legal =
C++, int exception</span></div></div></blockquote><div><br></div><div>Almos=
t:</div><div>http://eel.is/c++draft/except.throw#3</div><div> <div id=3D"3.=
sentence-3" class=3D"sentence">If the type of the exception object would be
an incomplete type,
an abstract class type (<a href=3D"http://eel.is/c++draft/class.abstract">[=
class.abstract]</a>),
or a pointer to an incomplete type other than <span class=3D"mathit">cv</sp=
an> <span class=3D"texttt"><span class=3D"keyword">void</span></span>
the program is ill-formed<a class=3D"hidden_link" href=3D"http://eel.is/c++=
draft/except.throw#3.sentence-3">.</a></div><div class=3D"sentence"><br></d=
iv><div class=3D"sentence">Pointers to incomplete types are copyable but no=
t throwable.<br></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/a8b7e511-ee61-4da1-85ed-d3e01895b84a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a8b7e511-ee61-4da1-85ed-d3e01895b84a=
%40isocpp.org</a>.<br />
------=_Part_827_2051713010.1550797440022--
------=_Part_826_160360712.1550797440022--
.