Skip to content

Commit a73c71e

Browse files
authored
Merge 2024-11 LWG Motion 2
P3136R1 Retiring niebloids
2 parents 6d81ed8 + 2739732 commit a73c71e

File tree

3 files changed

+38
-50
lines changed

3 files changed

+38
-50
lines changed

Diff for: source/algorithms.tex

+3-22
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,9 @@
3838
satisfying the assumptions on the algorithms.
3939

4040
\pnum
41-
The entities defined in the \tcode{std::ranges} namespace in this Clause
42-
are not found by argument-dependent name lookup\iref{basic.lookup.argdep}.
43-
When found by unqualified\iref{basic.lookup.unqual} name lookup
44-
for the \grammarterm{postfix-expression} in a function call\iref{expr.call},
45-
they inhibit argument-dependent name lookup.
46-
47-
\begin{example}
48-
\begin{codeblock}
49-
void foo() {
50-
using namespace std::ranges;
51-
std::vector<int> vec{1,2,3};
52-
find(begin(vec), end(vec), 2); // \#1
53-
}
54-
\end{codeblock}
55-
The function call expression at \tcode{\#1} invokes \tcode{std::ranges::find},
56-
not \tcode{std::find}, despite that
57-
(a) the iterator type returned from \tcode{begin(vec)} and \tcode{end(vec)}
58-
may be associated with namespace \tcode{std} and
59-
(b) \tcode{std::find} is more specialized\iref{temp.func.order} than
60-
\tcode{std::ranges::find} since the former requires
61-
its first two parameters to have the same type.
62-
\end{example}
41+
The entities defined in the \tcode{std::ranges} namespace in this Clause and
42+
specified as function templates are
43+
algorithm function objects\iref{alg.func.obj}.
6344

6445
\pnum
6546
For purposes of determining the existence of data races,

Diff for: source/iterators.tex

+2-26
Original file line numberDiff line numberDiff line change
@@ -2933,32 +2933,8 @@
29332933
\end{example}
29342934

29352935
\pnum
2936-
The function templates defined in \ref{range.iter.ops} are not found by
2937-
argument-dependent name lookup\iref{basic.lookup.argdep}. When found by
2938-
unqualified\iref{basic.lookup.unqual} name lookup for the
2939-
\grammarterm{postfix-expression} in a function call\iref{expr.call}, they
2940-
inhibit argument-dependent name lookup.
2941-
2942-
\begin{example}
2943-
\begin{codeblock}
2944-
void foo() {
2945-
using namespace std::ranges;
2946-
std::vector<int> vec{1,2,3};
2947-
distance(begin(vec), end(vec)); // \#1
2948-
}
2949-
\end{codeblock}
2950-
The function call expression at \tcode{\#1} invokes \tcode{std::ranges::distance},
2951-
not \tcode{std::distance}, despite that
2952-
(a) the iterator type returned from \tcode{begin(vec)} and \tcode{end(vec)}
2953-
may be associated with namespace \tcode{std} and
2954-
(b) \tcode{std::distance} is more specialized\iref{temp.func.order} than
2955-
\tcode{std::ranges::distance} since the former requires its first two parameters
2956-
to have the same type.
2957-
\end{example}
2958-
2959-
\pnum
2960-
The number and order of deducible template parameters for the function templates defined
2961-
in \ref{range.iter.ops} is unspecified, except where explicitly stated otherwise.
2936+
The entities defined in \ref{range.iter.ops} are
2937+
algorithm function objects\iref{alg.func.obj}.
29622938

29632939
\rSec3[range.iter.op.advance]{\tcode{ranges::advance}}
29642940

Diff for: source/lib-intro.tex

+33-2
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,40 @@
856856
\item \tcode{std::move(as_const(p))(args...)}
857857
\end{itemize}
858858

859+
\rSec3[alg.func.obj]{Algorithm function objects}
860+
861+
\pnum
862+
An \defn{algorithm function object} is
863+
a customization point object\iref{customization.point.object}
864+
that is specified as one or more overloaded function templates.
865+
The name of these function templates designates
866+
the corresponding algorithm function object.
867+
859868
\pnum
860-
Each customization point object type constrains its return type to model a
861-
particular concept.
869+
For an algorithm function object \tcode{o},
870+
let $S$ be the corresponding set of function templates.
871+
Then for any sequence of arguments $\tcode{args} \dotsc$,
872+
$\tcode{o(args} \dotsc \tcode{)}$ is expression-equivalent to
873+
$\tcode{s(args} \dotsc \tcode{)}$,
874+
where the result of name lookup for \tcode{s} is the overload set $S$.
875+
\begin{note}
876+
Algorithm function objects are not found by
877+
argument-dependent name lookup\iref{basic.lookup.argdep}.
878+
When found by unqualified name lookup\iref{basic.lookup.unqual}
879+
for the \grammarterm{postfix-expression} in a function call\iref{expr.call},
880+
they inhibit argument-dependent name lookup.
881+
\begin{example}
882+
\begin{codeblock}
883+
void foo() {
884+
using namespace std::ranges;
885+
std::vector<int> vec{1,2,3};
886+
find(begin(vec), end(vec), 2); // \#1
887+
}
888+
\end{codeblock}
889+
The function call expression at \#1 invokes \tcode{std::ranges::find},
890+
not \tcode{std::find}.
891+
\end{example}
892+
\end{note}
862893

863894
\rSec3[functions.within.classes]{Functions within classes}
864895

0 commit comments

Comments
 (0)