Skip to content

Commit

Permalink
[class.compare] Don't introduce V for the return value (#6035)
Browse files Browse the repository at this point in the history
In both cases, I'm not sure introducing `V` helps much - just requires name lookup for `V`. If we just say "the return value" in every case, I think that's clearer.
  • Loading branch information
brevzin authored Nov 10, 2023
1 parent 10e2799 commit 78300aa
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6503,16 +6503,16 @@
is usable\iref{class.compare.default}.

\pnum
The return value \tcode{V} of a defaulted \tcode{==} operator function
The return value of a defaulted \tcode{==} operator function
with parameters \tcode{x} and \tcode{y} is determined
by comparing corresponding elements $\tcode{x}_i$ and $\tcode{y}_i$
in the expanded lists of subobjects for \tcode{x} and \tcode{y}
(in increasing index order)
until the first index $i$
where $\tcode{x}_i\tcode{ == }\tcode{y}_i$ yields a result value which,
when contextually converted to \tcode{bool}, yields \tcode{false}.
If no such index exists, \tcode{V} is \tcode{true}.
Otherwise, \tcode{V} is \tcode{false}.
The return value is \tcode{true} if such an index exists
and \tcode{false} otherwise.

\pnum
\begin{example}
Expand Down Expand Up @@ -6611,7 +6611,7 @@
\end{itemize}

\pnum
The return value \tcode{V} of type \tcode{R}
The return value of type \tcode{R}
of the defaulted three-way comparison operator function
with parameters \tcode{x} and \tcode{y} of the same type
is determined by comparing corresponding elements
Expand All @@ -6622,10 +6622,10 @@
the synthesized three-way comparison of type \tcode{R}
between $\tcode{x}_i$ and $\tcode{y}_i$
yields a result value $\tcode{v}_i$ where $\tcode{v}_i \mathrel{\tcode{!=}} 0$,
contextually converted to \tcode{bool}, yields \tcode{true};
\tcode{V} is a copy of $\tcode{v}_i$.
If no such index exists, \tcode{V} is
\tcode{static_cast<R>(std::strong_ordering::equal)}.
contextually converted to \tcode{bool}, yields \tcode{true}.
The return value is a copy of $\tcode{v}_i$
if such an index exists and
\tcode{static_cast<R>(std::strong_ordering::equal)} otherwise.

\pnum
The \defn{common comparison type} \tcode{U}
Expand Down

0 comments on commit 78300aa

Please sign in to comment.