C++ concepts: FunctionObject
From cppreference.com
A FunctionObject
type is the type of an object that can be used on the left of the function call operator.
[edit] Requirements
The type T
satisfies FunctionObject
if
- The type
T
satisfies std::is_object, and
Given
-
f
, a value of typeT
orconst T
-
args
, suitable argument list, which may be empty
The following expressions must be valid:
Expression | Requirements |
---|---|
f(args) | performs a function call |
[edit] Notes
Functions and references to functions are not function object types, but can be used where function object types are expected due to function-to-pointer implicit conversion.
[edit] Standard library
- All pointers to functions satisfy this requirement.
In addition, the following standard library facilities require a FunctionObject
which isn't Callable
, Hash
, or Predicate
type.
std::unique_ptr |