Skip to content

Commit 4ac1f96

Browse files
committed
[concepts.equality] Add missing paragraph numbers, reorder implicit
expression variations in example for clarity and to fix overfull hbox.
1 parent 60ae4bf commit 4ac1f96

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

source/concepts.tex

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
requirements of the declared expression. The extent to which an implementation
7878
validates the syntax of the variations is unspecified.
7979

80+
\pnum
8081
\begin{example}
8182
\begin{codeblock}
8283
template<class T> concept C = requires(T a, T b, const T c, const T d) {
@@ -86,30 +87,40 @@
8687
};
8788
\end{codeblock}
8889

90+
For the above example:
91+
\begin{itemize}
92+
\item
8993
Expression \#1 does not modify either of its operands, \#2 modifies both of its
9094
operands, and \#3 modifies only its first operand \tcode{a}.
9195

96+
\item
9297
Expression \#1 implicitly requires additional expression variations that meet
9398
the requirements for \tcode{c == d} (including non-modification), as if the
9499
expressions
95100
\begin{codeblock}
96-
a == d; a == b; a == std::move(b); a == std::move(d);
97-
c == a; c == std::move(a); c == std::move(d);
98-
std::move(a) == d; std::move(a) == b;
99-
std::move(a) == std::move(b); std::move(a) == std::move(d);
100-
std::move(c) == b; std::move(c) == std::move(b);
101-
std::move(c) == d; std::move(c) == std::move(d);
101+
c == b;
102+
c == std::move(d); c == std::move(b);
103+
std::move(c) == d; std::move(c) == b;
104+
std::move(c) == std::move(d); std::move(c) == std::move(b);
105+
106+
a == d; a == b;
107+
a == std::move(d); a == std::move(b);
108+
std::move(a) == d; std::move(a) == b;
109+
std::move(a) == std::move(d); std::move(a) == std::move(b);
102110
\end{codeblock}
103111
had been declared as well.
104112

113+
\item
105114
Expression \#3 implicitly requires additional expression variations that meet
106115
the requirements for \tcode{a = c} (including non-modification of the second
107116
operand), as if the expressions \tcode{a = b} and \tcode{a = std::move(c)} had
108117
been declared. Expression \#3 does not implicitly require an expression
109118
variation with a non-constant rvalue second operand, since expression \#2
110119
already specifies exactly such an expression explicitly.
120+
\end{itemize}
111121
\end{example}
112122

123+
\pnum
113124
\begin{example}
114125
The following type \tcode{T} meets the explicitly stated syntactic requirements
115126
of concept \tcode{C} above but does not meet the additional implicit
@@ -125,7 +136,7 @@
125136
\tcode{T} fails to meet the implicit requirements of \tcode{C}, so \tcode{C<T>}
126137
is not satisfied. Since implementations are not required to validate the syntax
127138
of implicit requirements, it is unspecified whether an implementation diagnoses
128-
as ill-formed a program which requires \tcode{C<T>}.
139+
as ill-formed a program that requires \tcode{C<T>}.
129140
\end{example}
130141

131142
\rSec1[concepts.syn]{Header \tcode{<concepts>} synopsis}

0 commit comments

Comments
 (0)