Discussion:
[PATCH] Add missing noexpect causes in tuple for move functions
Nicholas Krause
2018-11-30 23:05:29 UTC
Permalink
This adds the remainging noexcept causes required for this cause
to meet the spec as dicussed last year and documented here:
http://cplusplus.github.io/LWG/lwg-active.html#2899.

Signed-off-by: Nicholas Krause <***@gmail.com>
---
libstdc++-v3/include/std/tuple | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index 56b97c25eed..d17512a1b7e 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -214,6 +214,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
enable_if<sizeof...(_Tail) == sizeof...(_UTail)>::type>
explicit
constexpr _Tuple_impl(_UHead&& __head, _UTail&&... __tail)
+ noexcept(__and_<is_nothrow_move_constructible<_Head>,
+ is_nothrow_move_constructible<_Inherited>>::value)
: _Inherited(std::forward<_UTail>(__tail)...),
_Base(std::forward<_UHead>(__head)) { }

@@ -237,6 +239,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION

template<typename _UHead, typename... _UTails>
constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in)
+ noexcept(__and_<is_nothrow_move_constructible<_Head>,
+ is_nothrow_move_constructible<_Inherited>>::value)
: _Inherited(std::move
(_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))),
_Base(std::forward<_UHead>
--
2.17.1
Ville Voutilainen
2018-11-30 23:12:12 UTC
Permalink
Post by Nicholas Krause
This adds the remainging noexcept causes required for this cause
http://cplusplus.github.io/LWG/lwg-active.html#2899.
I don't see how this change is sufficient; the noexcept-specs need to
be added to tuple's
special member functions, not just to _Tuple_impl, and your suggested
patch contains no
tests.
nick
2018-12-01 01:03:37 UTC
Permalink
Post by Ville Voutilainen
Post by Nicholas Krause
This adds the remainging noexcept causes required for this cause
http://cplusplus.github.io/LWG/lwg-active.html#2899.
I don't see how this change is sufficient; the noexcept-specs need to
be added to tuple's
special member functions, not just to _Tuple_impl, and your suggested
patch contains no
tests.
It was tested I just didn't mention that as it was assumed, that's my mistake and
sorry for that. This was more just to make sure that this is fine. If you would
prefer I send a patch cleaning it up for all the classes i.e. tuple, and it's
version's that's fine. I just want to ask do you want a patch or a series will
each patch touching one of the tuple clases as I assume your the maintainer.

Cheers,

Nick

Loading...