Function objects
A function object is any object for which the function call operator is defined. C++ provides many built-in function objects as well as support for creation and manipulation of new function objects.
Contents |
[edit] Function invocation
|
The exposition-only operation Let type
|
(since C++11) |
std::invoke and std::invoke_r(since C++23) can invoke any Callable object with given arguments according to the rules of INVOKE and INVOKE<R>(since C++23).
| (C++17)(C++23) |
invokes any Callable object with given arguments and possibility to specify return type(since C++23) (function template) |
[edit] Function wrappers
These polymorphic wrapper classes provide support for storing arbitrary function objects.
| (C++11) |
copyable wrapper of any copy constructible callable object (class template) |
| (C++23) |
move-only wrapper of any callable object that supports qualifiers in a given call signature (class template) |
| (C++26) |
copyable wrapper of any copy constructible callable object that supports qualifiers in a given call signature (class template) |
| (C++26) |
non-owning wrapper of any callable object (class template) |
| (C++11) |
the exception thrown when invoking an empty std::function (class) |
| |