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(nontype_t<f>) -> function_ref<see below>;
Let F be remove_pointer_t<decltype(f)>.
Constraints: is_function_v<F> is true.
Remarks: The deduced type is function_ref<F>.
template<auto f, class T> function_ref(nontype_t<f>, T&&) -> function_ref<see below>;
Let F be decltype(f).
Constraints:
  • F is of the form R(G​::​*)(A...) cv & noexcept(E) for a type G, or
  • 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 false, 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)>.