Section

std::function_ref

Class template std::function_ref is a non-owning function wrapper. std::function_ref objects can store and invoke reference to Callable target - functions, lambda expressions, bind expressions, or other function objects, but not pointers to member functions and pointers to member objects. std::nontype can be used to construct std::function_ref by passing function pointers, pointers to member functions, and pointers to member objects.

# Declarations

template< class... >
class function_ref; // not defined

(since C++26)

template< class R, class... Args >
class function_ref<R(Args...)>;
template< class R, class... Args >
class function_ref<R(Args...) noexcept>;
template< class R, class... Args >
class function_ref<R(Args...) const>;
template< class R, class... Args >
class function_ref<R(Args...) const noexcept>;

(since C++26)

# Notes

Feature-test macro Value Std Feature __cpp_lib_function_ref 202306L (C++26) std::function_ref

# Example

This section is incompleteReason: example

# See also