tmp/tmppn_m8s9v/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Algorithm function objects <a id="alg.func.obj">[[alg.func.obj]]</a>
|
| 2 |
+
|
| 3 |
+
An *algorithm function object* is a customization point object
|
| 4 |
+
[[customization.point.object]] that is specified as one or more
|
| 5 |
+
overloaded function templates. The name of these function templates
|
| 6 |
+
designates the corresponding algorithm function object.
|
| 7 |
+
|
| 8 |
+
For an algorithm function object `o`, let S be the corresponding set of
|
| 9 |
+
function templates. Then for any sequence of arguments `args` …,
|
| 10 |
+
`o(args` … `)` is expression-equivalent to `s(args` … `)`, where the
|
| 11 |
+
result of name lookup for `s` is the overload set S.
|
| 12 |
+
|
| 13 |
+
[*Note 1*:
|
| 14 |
+
|
| 15 |
+
Algorithm function objects are not found by argument-dependent name
|
| 16 |
+
lookup [[basic.lookup.argdep]]. When found by unqualified name lookup
|
| 17 |
+
[[basic.lookup.unqual]] for the *postfix-expression* in a function call
|
| 18 |
+
[[expr.call]], they inhibit argument-dependent name lookup.
|
| 19 |
+
|
| 20 |
+
[*Example 1*:
|
| 21 |
+
|
| 22 |
+
``` cpp
|
| 23 |
+
void foo() {
|
| 24 |
+
using namespace std::ranges;
|
| 25 |
+
std::vector<int> vec{1,2,3};
|
| 26 |
+
find(begin(vec), end(vec), 2); // #1
|
| 27 |
+
}
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
The function call expression at \#1 invokes `std::ranges::find`, not
|
| 31 |
+
`std::find`.
|
| 32 |
+
|
| 33 |
+
— *end example*]
|
| 34 |
+
|
| 35 |
+
— *end note*]
|
| 36 |
+
|