22 General utilities library [utilities]

22.10 Function objects [function.objects]

22.10.17 Polymorphic function wrappers [func.wrap]

22.10.17.6 Non-owning wrapper [func.wrap.ref]

22.10.17.6.5 Deduction guides [func.wrap.ref.deduct]

template<class F> function_ref(F*) -> function_ref<F>;
Constraints: is_function_v<F> is true.
template<auto f> function_ref(constant_arg_t<f>) -> function_ref<see below>;
Remarks: The deduced type is function_ref<F>.
template<auto f, class T> function_ref(constant_arg_t<f>, T&&) -> function_ref<see below>;
Constraints:
  • F is of the form R(G​::​*)(A..) cv &
  • F is of the form M G​::​* for a type G and an object type M, in which case let R be invoke_result_t<F, T&>, A.. be an empty pack, and E be true, or
  • F is of the form R(*)(G, A..) noexcept(E) for a type G.
Remarks: The deduced type is function_ref<R(A..) noexcept(E)>.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant