|
77 | 77 | requirements of the declared expression. The extent to which an implementation
|
78 | 78 | validates the syntax of the variations is unspecified.
|
79 | 79 |
|
| 80 | +\pnum |
80 | 81 | \begin{example}
|
81 | 82 | \begin{codeblock}
|
82 | 83 | template<class T> concept C = requires(T a, T b, const T c, const T d) {
|
|
86 | 87 | };
|
87 | 88 | \end{codeblock}
|
88 | 89 |
|
| 90 | +For the above example: |
| 91 | +\begin{itemize} |
| 92 | +\item |
89 | 93 | Expression \#1 does not modify either of its operands, \#2 modifies both of its
|
90 | 94 | operands, and \#3 modifies only its first operand \tcode{a}.
|
91 | 95 |
|
| 96 | +\item |
92 | 97 | Expression \#1 implicitly requires additional expression variations that meet
|
93 | 98 | the requirements for \tcode{c == d} (including non-modification), as if the
|
94 | 99 | expressions
|
95 | 100 | \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); |
102 | 110 | \end{codeblock}
|
103 | 111 | had been declared as well.
|
104 | 112 |
|
| 113 | +\item |
105 | 114 | Expression \#3 implicitly requires additional expression variations that meet
|
106 | 115 | the requirements for \tcode{a = c} (including non-modification of the second
|
107 | 116 | operand), as if the expressions \tcode{a = b} and \tcode{a = std::move(c)} had
|
108 | 117 | been declared. Expression \#3 does not implicitly require an expression
|
109 | 118 | variation with a non-constant rvalue second operand, since expression \#2
|
110 | 119 | already specifies exactly such an expression explicitly.
|
| 120 | +\end{itemize} |
111 | 121 | \end{example}
|
112 | 122 |
|
| 123 | +\pnum |
113 | 124 | \begin{example}
|
114 | 125 | The following type \tcode{T} meets the explicitly stated syntactic requirements
|
115 | 126 | of concept \tcode{C} above but does not meet the additional implicit
|
|
125 | 136 | \tcode{T} fails to meet the implicit requirements of \tcode{C}, so \tcode{C<T>}
|
126 | 137 | is not satisfied. Since implementations are not required to validate the syntax
|
127 | 138 | 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>}. |
129 | 140 | \end{example}
|
130 | 141 |
|
131 | 142 | \rSec1[concepts.syn]{Header \tcode{<concepts>} synopsis}
|
|
0 commit comments