Skip to content

Commit 03bff95

Browse files
jensmaurertkoeppe
authored andcommitted
P2136R3 invoke_r
Also fixes LWG2690.
1 parent 419ea29 commit 03bff95

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

source/support.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@
625625
#define @\defnlibxname{cpp_lib_integral_constant_callable}@ 201304L // also in \libheader{type_traits}
626626
#define @\defnlibxname{cpp_lib_interpolate}@ 201902L // also in \libheader{cmath}, \libheader{numeric}
627627
#define @\defnlibxname{cpp_lib_invoke}@ 201411L // also in \libheader{functional}
628+
#define @\defnlibxname{cpp_lib_invoke_r}@ 202106L // also in \libheader{functional}
628629
#define @\defnlibxname{cpp_lib_is_aggregate}@ 201703L // also in \libheader{type_traits}
629630
#define @\defnlibxname{cpp_lib_is_constant_evaluated}@ 201811L // also in \libheader{type_traits}
630631
#define @\defnlibxname{cpp_lib_is_final}@ 201402L // also in \libheader{type_traits}

source/utilities.tex

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13490,6 +13490,10 @@
1349013490
constexpr invoke_result_t<F, Args...> invoke(F&& f, Args&&... args)
1349113491
noexcept(is_nothrow_invocable_v<F, Args...>);
1349213492

13493+
template<class R, class F, class... Args>
13494+
constexpr R invoke_r(F&& f, Args&&... args)
13495+
noexcept(is_nothrow_invocable_r_v<R, F, Args...>);
13496+
1349313497
// \ref{refwrap}, \tcode{reference_wrapper}
1349413498
template<class T> class reference_wrapper;
1349513499

@@ -13793,7 +13797,7 @@
1379313797
a given standard library function template have the same type
1379413798
if the types of their corresponding state entities are the same.
1379513799

13796-
\rSec2[func.invoke]{Function template \tcode{invoke}}
13800+
\rSec2[func.invoke]{\tcode{invoke} functions}
1379713801
\indexlibraryglobal{invoke}%
1379813802
\indexlibrary{invoke@\tcode{\placeholder{INVOKE}}}%
1379913803
\begin{itemdecl}
@@ -13803,11 +13807,32 @@
1380313807
\end{itemdecl}
1380413808

1380513809
\begin{itemdescr}
13810+
\pnum
13811+
\constraints
13812+
\tcode{is_invocable_v<F, Args...>} is \tcode{true}.
13813+
1380613814
\pnum
1380713815
\returns
1380813816
\tcode{\placeholdernc{INVOKE}(std::forward<F>(f), std::forward<Args>(args)...)}\iref{func.require}.
1380913817
\end{itemdescr}
1381013818

13819+
\indexlibraryglobal{invoke_r}%
13820+
\begin{itemdecl}
13821+
template<class R, class F, class... Args>
13822+
constexpr R invoke_r(F&& f, Args&&... args)
13823+
noexcept(is_nothrow_invocable_r_v<R, F, Args...>);
13824+
\end{itemdecl}
13825+
13826+
\begin{itemdescr}
13827+
\pnum
13828+
\constraints
13829+
\tcode{is_invocable_r_v<R, F, Args...>} is \tcode{true}.
13830+
13831+
\pnum
13832+
\returns
13833+
\tcode{\placeholdernc{INVOKE}<R>(std::forward<F>(f), std::forward<Args>(args)...)}\iref{func.require}.
13834+
\end{itemdescr}
13835+
1381113836
\rSec2[refwrap]{Class template \tcode{reference_wrapper}}
1381213837

1381313838
\rSec3[refwrap.general]{General}

0 commit comments

Comments
 (0)