Files
cppdraft_translate/cppdraft/func/wrap/ref/deduct.md
2025-10-25 03:02:53 +03:00

2.2 KiB
Raw Blame History

[func.wrap.ref.deduct]

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>;

1

#

Constraints: is_function_v is true.

🔗

template<auto f> function_ref(nontype_t<f>) -> function_ref<see below>;

2

#

Let F be remove_pointer_t<decltype(f)>.

3

#

Constraints: is_function_v is true.

4

#

Remarks: The deduced type is function_ref.

🔗

template<auto f, class T> function_ref(nontype_t<f>, T&&) -> function_ref<see below>;

5

#

Let F be decltype(f).

6

#

Constraints:

F is of the formR(G::*)(A...) cv &opt noexcept(E) for a type G, or

F is of the formM 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, andE be false, or

F is of the formR(*)(G, A...) noexcept(E) for a type G.

7

#

Remarks: The deduced type is function_ref<R(A...) noexcept(E)>.