This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Attempt to make std::pair piecewise constructor noexcept


On 16/12/18 18:48 +0100, François Dumont wrote:
@@ -372,7 +361,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
	  second(std::forward<_U2>(__p.second)) { }

      template<typename... _Args1, typename... _Args2>
-        pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
+	pair(piecewise_construct_t,
+	     tuple<_Args1...> __first, tuple<_Args2...> __second)
+	noexcept( noexcept(
+	  pair(declval<tuple<_Args1...>&>(), declval<tuple<_Args2...>&>(),
+	       declval<typename _Build_index_tuple<sizeof...(_Args1)>::__type>(),
+	       declval<typename _Build_index_tuple<sizeof...(_Args2)>::__type>())) )
+	: pair(__first, __second,
+	       typename _Build_index_tuple<sizeof...(_Args1)>::__type(),
+	       typename _Build_index_tuple<sizeof...(_Args2)>::__type())
+	{ }

Surely just:

     noexcept(
	is_nothrow_constructible<_T1, _Args1...>
       &&
	is_nothrow_constructible<_T2, _Args2...>
     )

?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]