Files
cppdraft_translate/cppdraft/alg/func/obj.md
2025-10-25 03:02:53 +03:00

2.1 KiB
Raw Blame History

[alg.func.obj]

16 Library introduction [library]

16.3 Method of description [description]

16.3.3 Other conventions [conventions]

16.3.3.4 Algorithm function objects [alg.func.obj]

1

#

An algorithm function object is a customization point object ([customization.point.object]) that is specified as one or more overloaded function templates.

The name of these function templates designates the corresponding algorithm function object.

2

#

For an algorithm function object o, let S be the corresponding set of function templates.

Then for any sequence of arguments args …,o(args …) is expression-equivalent tos(args …), where the result of name lookup for s is the overload set S.

[Note 1:

Algorithm function objects are not found by argument-dependent name lookup ([basic.lookup.argdep]).

When found by unqualified name lookup ([basic.lookup.unqual]) for the postfix-expression in a function call ([expr.call]), they inhibit argument-dependent name lookup.

[Example 1: void foo() {using namespace std::ranges; std::vector vec{1,2,3}; find(begin(vec), end(vec), 2); // #1}

The function call expression at #1 invokes std::ranges::find, not std::find.

— end example]

— end note]