[libcxx-commits] [PATCH] D58097: std::invoke should use std::is_nothrow_callable (2807)

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 11 21:11:52 PST 2019


zoecarver created this revision.
zoecarver added reviewers: EricWF, mclow.lists.
Herald added subscribers: libcxx-commits, jdoerfert, ldionne.

Use `std::is_nothrow_callable` for `std::invoke` according to 2807 <https://cplusplus.github.io/LWG/issue2807>.


Repository:
  rCXX libc++

https://reviews.llvm.org/D58097

Files:
  include/functional
  www/cxx1z_status.html


Index: www/cxx1z_status.html
===================================================================
--- www/cxx1z_status.html
+++ www/cxx1z_status.html
@@ -461,7 +461,7 @@
 	<tr><td><a href="https://wg21.link/LWG2802">2802</a></td><td>shared_ptr constructor requirements for a deleter</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="https://wg21.link/LWG2804">2804</a></td><td>Unconditional constexpr default constructor for istream_iterator</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2806">2806</a></td><td>Base class of bad_optional_access</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="https://wg21.link/LWG2807">2807</a></td><td>std::invoke should use std::is_nothrow_callable</td><td>Kona</td><td></td></tr>
+	<tr><td><a href="https://wg21.link/LWG2807">2807</a></td><td>std::invoke should use std::is_nothrow_callable</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2812">2812</a></td><td>Range access is available with <string_view></td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2824">2824</a></td><td>list::sort should say that the order of elements is unspecified if an exception is thrown</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2826">2826</a></td><td>string_view iterators use old wording</td><td>Kona</td><td>Complete</td></tr>
Index: include/functional
===================================================================
--- include/functional
+++ include/functional
@@ -2769,9 +2769,9 @@
 #if _LIBCPP_STD_VER > 14
 
 template <class _Fn, class ..._Args>
-result_of_t<_Fn&&(_Args&&...)>
+invoke_result_t<_Fn, _Args...>
 invoke(_Fn&& __f, _Args&&... __args)
-    noexcept(noexcept(_VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...)))
+    noexcept(is_nothrow_invocable_v<_Fn, _Args...>)
 {
     return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58097.186394.patch
Type: text/x-patch
Size: 1980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190212/3056c31b/attachment.bin>


More information about the libcxx-commits mailing list