Topic: Noexcept on classes?
Author: Johannes Schaub <schaub.johannes@googlemail.com>
Date: Wed, 3 Apr 2013 12:33:38 -0700 (PDT)
Raw View
------=_Part_139_4192823.1365017618829
Content-Type: text/plain; charset=ISO-8859-1
Some frameworks do not care about exceptions. Therefor, it would seem to me
that they would like to mark all member functions of all classes as
"noexcept". To prevent the repetition of the keyword, it would seem worth
to allow "noexcept" on classes.
class A noexcept {
// ... use "noexcept(false)" to override it for some members
};
What do you think about it?
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
------=_Part_139_4192823.1365017618829
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Some frameworks do not care about exceptions. Therefor, it would seem to me=
that they would like to mark all member functions of all classes as "noexc=
ept". To prevent the repetition of the keyword, it would seem worth to allo=
w "noexcept" on classes.<div><br></div><div> class A noexcept =
{</div><div> // ... use "noexcept(false)" to override i=
t for some members</div><div> };</div><div><br></div><div>What=
do you think about it?</div>
<p></p>
-- <br />
<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_139_4192823.1365017618829--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Wed, 3 Apr 2013 17:44:02 -0700 (PDT)
Raw View
------=_Part_448_26676857.1365036242140
Content-Type: text/plain; charset=ISO-8859-1
On Wednesday, April 3, 2013 12:33:38 PM UTC-7, Johannes Schaub wrote:
>
> Some frameworks do not care about exceptions. Therefor, it would seem to
> me that they would like to mark all member functions of all classes as
> "noexcept". To prevent the repetition of the keyword, it would seem worth
> to allow "noexcept" on classes.
>
> class A noexcept {
> // ... use "noexcept(false)" to override it for some members
> };
>
> What do you think about it?
>
`noexcept` is not for people who "do not care about exceptions". Indeed,
using a `noexcept` specifier means that you very much *do care* about
exceptions. You care enough to say, "this code will not emit exceptions".
If you care enough to say that, then you care enough to say it on a
per-function basis.
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
------=_Part_448_26676857.1365036242140
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Wednesday, April 3, 2013 12:33:38 PM UTC-7, Johannes Schaub wrote:<block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;">Some frameworks do not care about ex=
ceptions. Therefor, it would seem to me that they would like to mark all me=
mber functions of all classes as "noexcept". To prevent the repetition of t=
he keyword, it would seem worth to allow "noexcept" on classes.<div><br></d=
iv><div> class A noexcept {</div><div> // =
.... use "noexcept(false)" to override it for some members</div><div> =
};</div><div><br></div><div>What do you think about it?</div></block=
quote><div><br>`noexcept` is not for people who "do not care about exceptio=
ns". Indeed, using a `noexcept` specifier means that you very much <i>do ca=
re</i> about exceptions. You care enough to say, "this code will not emit e=
xceptions".<br><br>If you care enough to say that, then you care enough to =
say it on a per-function basis.<br></div>
<p></p>
-- <br />
<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_448_26676857.1365036242140--
.
Author: "J. Daniel Garcia" <josedaniel.garcia@uc3m.es>
Date: Thu, 4 Apr 2013 09:50:04 -0500
Raw View
--047d7b3a9b4c6788c304d98a18d0
Content-Type: text/plain; charset=ISO-8859-1
I recommend reading
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3279.pdf
For a discussion on using noexcept in the std library.
This leads to the question on benefits and harms of noexcept.
I think that a class-wide use of noexcept would promote marking classes as
noexcept without thinking to much of real benefits of doing so.
--
J. Daniel
On Wed, Apr 3, 2013 at 7:44 PM, Nicol Bolas <jmckesson@gmail.com> wrote:
> On Wednesday, April 3, 2013 12:33:38 PM UTC-7, Johannes Schaub wrote:
>>
>> Some frameworks do not care about exceptions. Therefor, it would seem to
>> me that they would like to mark all member functions of all classes as
>> "noexcept". To prevent the repetition of the keyword, it would seem worth
>> to allow "noexcept" on classes.
>>
>> class A noexcept {
>> // ... use "noexcept(false)" to override it for some members
>> };
>>
>> What do you think about it?
>>
>
> `noexcept` is not for people who "do not care about exceptions". Indeed,
> using a `noexcept` specifier means that you very much *do care* about
> exceptions. You care enough to say, "this code will not emit exceptions".
>
> If you care enough to say that, then you care enough to say it on a
> per-function basis.
>
> --
>
> ---
> 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.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
>
>
>
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
--047d7b3a9b4c6788c304d98a18d0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I recommend reading<div><br></div><div><a href=3D"http://w=
ww.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3279.pdf">http://www.open-=
std.org/jtc1/sc22/wg21/docs/papers/2011/n3279.pdf</a></div><div><br></div><=
div style>
For a discussion on using noexcept in the std library.</div><div style><br>=
</div><div style>This leads to the question on benefits and harms of noexce=
pt.</div><div style><br></div><div style>I think that a class-wide use of n=
oexcept would promote marking classes as noexcept without thinking to much =
of real benefits of doing so.</div>
<div style><br></div><div style>--</div><div style>=A0J. Daniel</div><div s=
tyle><br></div><div style><br></div><div class=3D"gmail_extra"><br><br><div=
class=3D"gmail_quote">On Wed, Apr 3, 2013 at 7:44 PM, Nicol Bolas <span di=
r=3D"ltr"><<a href=3D"mailto:jmckesson@gmail.com" target=3D"_blank">jmck=
esson@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">On Wednesday, April 3, 201=
3 12:33:38 PM UTC-7, Johannes Schaub wrote:<blockquote class=3D"gmail_quote=
" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-le=
ft:1ex">
Some frameworks do not care about exceptions. Therefor, it would seem to me=
that they would like to mark all member functions of all classes as "=
noexcept". To prevent the repetition of the keyword, it would seem wor=
th to allow "noexcept" on classes.<div>
<br></div><div>=A0 =A0 class A noexcept {</div><div>=A0 =A0 =A0 // ... use =
"noexcept(false)" to override it for some members</div><div>=A0 =
=A0 };</div><div><br></div><div>What do you think about it?</div></blockquo=
te></div><div>
<br>`noexcept` is not for people who "do not care about exceptions&quo=
t;. Indeed, using a `noexcept` specifier means that you very much <i>do car=
e</i> about exceptions. You care enough to say, "this code will not em=
it exceptions".<br>
<br>If you care enough to say that, then you care enough to say it on a per=
-function basis.<br></div><div class=3D"HOEnZb"><div class=3D"h5">
<p></p>
-- <br>
=A0<br>
--- <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%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
=A0<br>
=A0<br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div></div><=
/div>
<p></p>
-- <br />
<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
--047d7b3a9b4c6788c304d98a18d0--
.
Author: Marc <marc.glisse@gmail.com>
Date: Thu, 4 Apr 2013 10:59:34 -0700 (PDT)
Raw View
------=_Part_512_1956412.1365098374091
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Le mercredi 3 avril 2013 21:33:38 UTC+2, Johannes Schaub a =E9crit :
>
> Some frameworks do not care about exceptions.
Replace "do not care" with "do not use, not even in the sense of letting=20
them pass through".
=20
> Therefor, it would seem to me that they would like to mark all member=20
> functions of all classes as "noexcept". To prevent the repetition of the=
=20
> keyword, it would seem worth to allow "noexcept" on classes.
>
> class A noexcept {
> // ... use "noexcept(false)" to override it for some members
> };
>
> What do you think about it?
>
It makes sense to me (even more so if we ever get noexcept(auto), but let's=
=20
not get side-tracked). Of course it is a bit dangerous in that we'll see=20
silly advice like "for performance, add noexcept to all your classes", but=
=20
that seems acceptable to me. Do you want to do the same for constexpr=20
afterwards? ;-)
--=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/?hl=3Den.
------=_Part_512_1956412.1365098374091
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Le mercredi 3 avril 2013 21:33:38 UTC+2, Johannes Schaub a =E9crit :<b=
lockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;borde=
r-left: 1px #ccc solid;padding-left: 1ex;">Some frameworks do not care abou=
t exceptions.</blockquote><div><br>Replace "do not care" with "do not use, =
not even in the sense of letting them pass through".<br> </div><blockq=
uote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left:=
1px solid rgb(204, 204, 204); padding-left: 1ex;"> Therefor, it would seem=
to me that they would like to mark all member functions of all classes as =
"noexcept". To prevent the repetition of the keyword, it would seem worth t=
o allow "noexcept" on classes.<div><br></div><div> class A noe=
xcept {</div><div> // ... use "noexcept(false)" to over=
ride it for some members</div><div> };</div><div><br></div><di=
v>What do you think about it?</div></blockquote><div><br>It makes sense to =
me (even more so if we ever get noexcept(auto), but let's not get side-trac=
ked). Of course it is a bit dangerous in that we'll see silly advice like "=
for performance, add noexcept to all your classes", but that seems acceptab=
le to me. Do you want to do the same for constexpr afterwards? ;-)<br></div=
>
<p></p>
-- <br />
<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
<br />
<br />
------=_Part_512_1956412.1365098374091--
.