diff --git a/source/utilities.tex b/source/utilities.tex index 09be66f705..37bfde5980 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -225,15 +225,6 @@ }; template constexpr in_place_index_t in_place_index{}; - // \tcode{constant_arg} argument tag% -\indexlibraryglobal{constant_arg_t}% -\indexlibraryglobal{constant_arg} - template - struct constant_arg_t { - explicit constant_arg_t() = default; - }; - template constexpr constant_arg_t constant_arg{}; - // \ref{variant.monostate}, class \tcode{monostate}% \indexlibraryglobal{monostate} struct monostate; @@ -15178,9 +15169,9 @@ // \ref{func.wrap.ref.ctor}, constructors and assignment operators template function_ref(F*) noexcept; template constexpr function_ref(F&&) noexcept; - template constexpr function_ref(constant_arg_t) noexcept; - template constexpr function_ref(constant_arg_t, U&&) noexcept; - template constexpr function_ref(constant_arg_t, @\cv{}@ T*) noexcept; + template constexpr function_ref(constant_wrapper) noexcept; + template constexpr function_ref(constant_wrapper, U&&) noexcept; + template constexpr function_ref(constant_wrapper, @\cv{}@ T*) noexcept; constexpr function_ref(const function_ref&) noexcept = default; constexpr function_ref& operator=(const function_ref&) noexcept = default; @@ -15311,21 +15302,26 @@ \indexlibraryctor{function_ref}% \begin{itemdecl} -template constexpr function_ref(constant_arg_t) noexcept; +template constexpr function_ref(constant_wrapper f) noexcept; \end{itemdecl} \begin{itemdescr} -\pnum -Let \tcode{F} be \tcode{decltype(f)}. - \pnum \constraints \tcode{\exposid{is-invocable-using}} is \tcode{true}. \pnum \mandates +\begin{itemize} +\item If \tcode{is_pointer_v || is_member_pointer_v} is \tcode{true}, -then \tcode{f != nullptr} is \tcode{true}. +then \tcode{f != nullptr} is \tcode{true}, and +\item +if \tcode{ArgTypes} is not an empty pack and +all types in \tcode{remove_cvref_t...} satisfy \exposconcept{const-expr-param} +then \tcode{constant_wrapper<\exposid{INVOKE}(f.value, remove_cvref_t::value...)>} +is not a valid type. +\end{itemize} \pnum \effects @@ -15341,14 +15337,13 @@ \indexlibraryctor{function_ref}% \begin{itemdecl} -template - constexpr function_ref(constant_arg_t, U&& obj) noexcept; +template + constexpr function_ref(constant_wrapper f, U&& obj) noexcept; \end{itemdecl} \begin{itemdescr} \pnum -Let \tcode{T} be \tcode{remove_reference_t} and -\tcode{F} be \tcode{decltype(f)}. +Let \tcode{T} be \tcode{remove_reference_t}. \pnum \constraints @@ -15360,7 +15355,7 @@ \pnum \mandates If \tcode{is_pointer_v || is_member_pointer_v} is \tcode{true}, -then \tcode{f != nullptr} is \tcode{true}. +then \tcode{f.value != nullptr} is \tcode{true}. \pnum \effects @@ -15370,19 +15365,16 @@ such that \tcode{\placeholder{thunk}(\exposid{bound-entity}, \placeholder{call-args}...)} is expression-equivalent\iref{defns.expression.equivalent} to -\tcode{invoke_r(f, static_cast<\cv{} T\&>(obj), \placeholder{call-args}...)}. +\tcode{invoke_r(f.value, static_cast<\cv{} T\&>(obj), \placeholder{call-args}...)}. \end{itemdescr} \indexlibraryctor{function_ref}% \begin{itemdecl} -template - constexpr function_ref(constant_arg_t, @\cv{}@ T* obj) noexcept; +template + constexpr function_ref(constant_wrapper f, @\cv{}@ T* obj) noexcept; \end{itemdecl} \begin{itemdescr} -\pnum -Let \tcode{F} be \tcode{decltype(f)}. - \pnum \constraints \tcode{\exposid{is-invocable-using}} is \tcode{true}. @@ -15390,7 +15382,7 @@ \pnum \mandates If \tcode{is_pointer_v || is_member_pointer_v} is \tcode{true}, -then \tcode{f != nullptr} is \tcode{true}. +then \tcode{f.value != nullptr} is \tcode{true}. \pnum \expects @@ -15405,7 +15397,7 @@ such that \tcode{\placeholder{thunk}(\exposid{bound-entity}, \placeholder{call-args}...)} is expression-equivalent\iref{defns.expression.equivalent} to -\tcode{invoke_r(f, obj, \placeholder{call-args}...)}. +\tcode{invoke_r(f.value, obj, \placeholder{call-args}...)}. \end{itemdescr} \indexlibrarymember{operator=}{function_ref}% @@ -15419,7 +15411,7 @@ \begin{itemize} \item \tcode{T} is not the same type as \tcode{function_ref}, \item \tcode{is_pointer_v} is \tcode{false}, and -\item \tcode{T} is not a specialization of \tcode{constant_arg_t}. +\item \tcode{T} is not a specialization of \tcode{constant_wrapper}. \end{itemize} \end{itemdescr}