A Callable type is a type for which the INVOKE and INVOKE<R> operations (used by, e.g., std::function, std::bind, and std::thread::thread) are applicable.
INVOKE
can be performed explicitly using the library function std::invoke.
INVOKE<R>
can be performed explicitly using the library function std::invoke_r.
The type T
satisfies Callable if
Given
f
, an object of type T
,ArgTypes
, suitable list of argument types,R
, suitable return type.The following expressions must be valid:
Expression Requirements INVOKE<R>(f, std::declval<ArgTypes>()...) The expression is well-formed in unevaluated context. [edit] NotesPointers to data members are Callable, even though no function calls take place.
[edit] Standard libraryIn addition, the following standard library facilities accept any Callable type (not just FunctionObject):
copyable wrapper of any copy constructible callable object(C++11)(removed in C++20)(C++17)
deduces the result type of invoking a callable object with a set of argumentsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4