Topic: Make std::tuple conditionally noexcept
Author: David Stone <deusexsophismata@gmail.com>
Date: Sat, 16 Nov 2013 13:32:56 -0800 (PST)
Raw View
------=_Part_418_22548307.1384637576279
Content-Type: text/plain; charset=ISO-8859-1
Would there be any reason not to declare the std::tuple constructors
conditionally noexcept if the relevant constructors for all the contained
types are noexcept? I am currently running into an issue where I am using a
std::tuple as the only data member of a class, and I am trying to declare
some of my constructors in the style of constexpr my_class(my_class const
&) noexcept = default;, but the default generated constructor is not
actually noexcept.
This seems like a fairly straightforward addition with simple standard
language.
--
---
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/.
------=_Part_418_22548307.1384637576279
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Would there be any reason not to declare the std::tuple co=
nstructors conditionally noexcept if the relevant constructors for all the =
contained types are noexcept? I am currently running into an issue where I =
am using a std::tuple as the only data member of a class, and I am trying t=
o declare some of my constructors in the style of constexpr my_class(my_cla=
ss const &) noexcept =3D default;, but the default generated constructo=
r is not actually noexcept.<br><br>This seems like a fairly straightforward=
addition with simple standard language.<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/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_418_22548307.1384637576279--
.
Author: Howard Hinnant <howard.hinnant@gmail.com>
Date: Sat, 16 Nov 2013 17:51:34 -0500
Raw View
On Nov 16, 2013, at 4:32 PM, David Stone <deusexsophismata@gmail.com> wrote=
:
> Would there be any reason not to declare the std::tuple constructors cond=
itionally noexcept if the relevant constructors for all the contained types=
are noexcept? I am currently running into an issue where I am using a std:=
:tuple as the only data member of a class, and I am trying to declare some =
of my constructors in the style of constexpr my_class(my_class const &) noe=
xcept =3D default;, but the default generated constructor is not actually n=
oexcept.
>=20
> This seems like a fairly straightforward addition with simple standard la=
nguage.
You've got my vote.
Positive implementation experience with tip-of-trunk libc++ and tip-of-trun=
k clang in c++1y mode:
struct my_class
{
std::tuple<int, double> data_;
constexpr my_class() noexcept =3D default;
constexpr my_class(my_class const&) noexcept =3D default;
};
static_assert(std::is_nothrow_default_constructible<my_class>::value, "");
static_assert(std::is_nothrow_copy_constructible<my_class>::value, "");
Howard
--=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/.
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Sun, 17 Nov 2013 01:26:31 +0200
Raw View
On 17 November 2013 00:51, Howard Hinnant <howard.hinnant@gmail.com> wrote:
>
> On Nov 16, 2013, at 4:32 PM, David Stone <deusexsophismata@gmail.com> wro=
te:
>
>> Would there be any reason not to declare the std::tuple constructors con=
ditionally noexcept if the relevant constructors for all the contained type=
s are noexcept? I am currently running into an issue where I am using a std=
::tuple as the only data member of a class, and I am trying to declare some=
of my constructors in the style of constexpr my_class(my_class const &) no=
except =3D default;, but the default generated constructor is not actually =
noexcept.
>>
>> This seems like a fairly straightforward addition with simple standard l=
anguage.
>
> You've got my vote.
Same here, looks like a very good idea.
--=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/.
.