Files
2025-10-25 03:02:53 +03:00

32 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[function.objects.general]
# 22 General utilities library [[utilities]](./#utilities)
## 22.10 Function objects [[function.objects]](function.objects#general)
### 22.10.1 General [function.objects.general]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/utilities.tex#L11215)
A [*function object type*](#def:function_object,type "22.10.1General[function.objects.general]") is an object
type ([[basic.types.general]](basic.types.general#term.object.type "6.9.1General")) that can be the type of the[*postfix-expression*](expr.post.general#nt:postfix-expression "7.6.1.1General[expr.post.general]") in a function call ([[expr.call]](expr.call "7.6.1.3Function call"), [[over.match.call]](over.match.call "12.2.2.2Function call syntax"))[.](#1.sentence-1)[193](#footnote-193 "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.")
A [*function object*](#def:function_object "22.10.1General[function.objects.general]") is an
object of a function object type[.](#1.sentence-2)
In the places where one would expect to pass a
pointer to a function to an algorithmic template ([[algorithms]](algorithms "26Algorithms library")), the
interface is specified to accept a function object[.](#1.sentence-3)
This not only makes
algorithmic templates work with pointers to functions, but also enables them to
work with arbitrary function objects[.](#1.sentence-4)
[193)](#footnote-193)[193)](#footnoteref-193)
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[.](#footnote-193.sentence-1)