mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-22 07:51:39 +08:00
[libc++] Use std::is_nothrow_callable for std::invoke according to LWG 2807
Thanks to Zoe Carver for the patch. Differential Revision: https://reviews.llvm.org/D58097 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@357616 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -230,6 +230,10 @@ template<class Fn, class... BoundArgs>
|
|||||||
template<class R, class Fn, class... BoundArgs>
|
template<class R, class Fn, class... BoundArgs>
|
||||||
unspecified bind(Fn&&, BoundArgs&&...);
|
unspecified bind(Fn&&, BoundArgs&&...);
|
||||||
|
|
||||||
|
template<class F, class... Args>
|
||||||
|
invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17
|
||||||
|
noexcept(is_nothrow_invocable_v<F, Args...>);
|
||||||
|
|
||||||
namespace placeholders {
|
namespace placeholders {
|
||||||
// M is the implementation-defined number of placeholders
|
// M is the implementation-defined number of placeholders
|
||||||
extern unspecified _1;
|
extern unspecified _1;
|
||||||
@@ -2769,9 +2773,9 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
|
|||||||
#if _LIBCPP_STD_VER > 14
|
#if _LIBCPP_STD_VER > 14
|
||||||
|
|
||||||
template <class _Fn, class ..._Args>
|
template <class _Fn, class ..._Args>
|
||||||
result_of_t<_Fn&&(_Args&&...)>
|
invoke_result_t<_Fn, _Args...>
|
||||||
invoke(_Fn&& __f, _Args&&... __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)...);
|
return _VSTD::__invoke(_VSTD::forward<_Fn>(__f), _VSTD::forward<_Args>(__args)...);
|
||||||
}
|
}
|
||||||
|
@@ -10,8 +10,9 @@
|
|||||||
|
|
||||||
// <functional>
|
// <functional>
|
||||||
|
|
||||||
// template <class F, class ...Args>
|
// template<class F, class... Args>
|
||||||
// result_of_t<F&&(Args&&...)> invoke(F&&, Args&&...);
|
// invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) // C++17
|
||||||
|
// noexcept(is_nothrow_invocable_v<_Fn, _Args...>);
|
||||||
|
|
||||||
/// C++14 [func.def] 20.9.0
|
/// C++14 [func.def] 20.9.0
|
||||||
/// (1) The following definitions apply to this Clause:
|
/// (1) The following definitions apply to this Clause:
|
||||||
|
@@ -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/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/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/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/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/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>
|
<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>
|
||||||
|
Reference in New Issue
Block a user