| Defined in header <functional>
|
||
| template< class F > function_ref( F* ) -> function_ref<F>; |
(1) | (since C++26) |
| template< auto f > function_ref( std::nontype_t<f> ) -> function_ref</*see below*/>; |
(2) | (since C++26) |
| template< auto f, class T > function_ref( std::nontype_t<f>, T&& ) -> function_ref</*see below*/>; |
(3) | (since C++26) |
2) Let type
F be std::remove_pointer_t<decltype(f)>. This overload participates in overload resolution only if std::is_function_v<F> is true. The deduced type is std::function_ref<F>.3) Let type
F be decltype(f). This overload participates in overload resolution only if :
-
Fis of the formR(G::*)(A...) noexcept(E)(optionally cv-qualified, optionally noexcept, optionally lvalue reference qualified) for a typeG, or -
Fis of the formM G::*for a typeGand an object typeM, in which case letRbestd::invoke_result_t<F, T&>,A...be an empty pack, andEbe false, or -
Fis of the formR(*)(G, A...) noexcept(E)for a typeG.
- The deduced type is
std::function_ref<R(A...) noexcept(E)>.
- The deduced type is
Example
This section is incomplete
Reason: no example
Reason: no example
Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.