Index: include/functional =================================================================== --- include/functional +++ include/functional @@ -229,6 +229,10 @@ unspecified bind(Fn&&, BoundArgs&&...); template unspecified bind(Fn&&, BoundArgs&&...); + +template + invoke_result_t invoke(F&& f, Args&&... args) // C++17 + noexcept(is_nothrow_invocable_v); namespace placeholders { // M is the implementation-defined number of placeholders @@ -2769,9 +2773,9 @@ #if _LIBCPP_STD_VER > 14 template -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)...); } Index: test/std/utilities/function.objects/func.invoke/invoke.pass.cpp =================================================================== --- test/std/utilities/function.objects/func.invoke/invoke.pass.cpp +++ test/std/utilities/function.objects/func.invoke/invoke.pass.cpp @@ -11,7 +11,11 @@ // // template -// result_of_t invoke(F&&, Args&&...); +// result_of_t invoke(F&&, Args&&...); // Pre-C++17 + +// template +// invoke_result_t invoke(F&& f, Args&&... args) // C++17 +// noexcept(is_nothrow_invocable_v<_Fn, _Args...>); /// C++14 [func.def] 20.9.0 /// (1) The following definitions apply to this Clause: Index: www/cxx1z_status.html =================================================================== --- www/cxx1z_status.html +++ www/cxx1z_status.html @@ -461,7 +461,7 @@ 2802shared_ptr constructor requirements for a deleterKona 2804Unconditional constexpr default constructor for istream_iteratorKonaComplete 2806Base class of bad_optional_accessKonaComplete - 2807std::invoke should use std::is_nothrow_callableKona + 2807std::invoke should use std::is_nothrow_callableKonaComplete 2812Range access is available with <string_view>KonaComplete 2824list::sort should say that the order of elements is unspecified if an exception is thrownKonaComplete 2826string_view iterators use old wordingKonaComplete