1.7 KiB
1.7 KiB
[function.objects.general]
22 General utilities library [utilities]
22.10 Function objects [function.objects]
22.10.1 General [function.objects.general]
A function object type is an object type ([basic.types.general]) that can be the type of thepostfix-expression in a function call ([expr.call], [over.match.call]).193
A function object is an object of a function object type.
In the places where one would expect to pass a pointer to a function to an algorithmic template ([algorithms]), the interface is specified to accept a function object.
This not only makes algorithmic templates work with pointers to functions, but also enables them to work with arbitrary function objects.
Such a type is a function pointer or a class type which has a member operator() or a class type which has a conversion to a pointer to function.