|
151 | 151 | whenever an algorithm expects a function object\iref{function.objects} that, |
152 | 152 | when applied to the result of dereferencing the corresponding iterator, |
153 | 153 | returns a value testable as \tcode{true}. |
154 | | -In other words, |
155 | | -if an algorithm takes \tcode{Predicate pred} as its argument and |
| 154 | +If an algorithm takes \tcode{Predicate pred} as its argument and |
156 | 155 | \tcode{first} as its iterator argument with value type \tcode{T}, |
157 | | -it should work correctly in the construct |
158 | | -\tcode{pred(*first)} contextually converted to \tcode{bool}\iref{conv}. |
| 156 | +the expression \tcode{pred(*first)} shall be well-formed and |
| 157 | +the type \tcode{decltype(pred(*first))} shall model |
| 158 | +\exposconcept{boolean-testable}\iref{concept.booleantestable}. |
159 | 159 | The function object \tcode{pred} shall not apply any non-constant function |
160 | | -through the dereferenced iterator. |
| 160 | +through its argument. |
161 | 161 | Given a glvalue \tcode{u} of type (possibly \keyword{const}) \tcode{T} |
162 | 162 | that designates the same object as \tcode{*first}, |
163 | 163 | \tcode{pred(u)} shall be a valid expression |
|
170 | 170 | to dereferencing an iterator and type \tcode{T} |
171 | 171 | when \tcode{T} is part of the signature, |
172 | 172 | returns a value testable as \tcode{true}. |
173 | | -In other words, |
174 | | -if an algorithm takes \tcode{BinaryPredicate binary_pred} as its argument and |
| 173 | +If an algorithm takes \tcode{BinaryPredicate binary_pred} as its argument and |
175 | 174 | \tcode{first1} and \tcode{first2} as its iterator arguments |
176 | 175 | with respective value types \tcode{T1} and \tcode{T2}, |
177 | | -it should work correctly in the construct |
178 | | -\tcode{binary_pred(*first1, *first2)} contextually converted to \tcode{bool}\iref{conv}. |
| 176 | +the expression \tcode{binary_pred(*first1, *first2)} shall be well-formed and |
| 177 | +the type \tcode{decltype(binary_pred(*first1, *first2))} shall model |
| 178 | +\exposconcept{boolean-testable}. |
179 | 179 | Unless otherwise specified, |
180 | 180 | \tcode{BinaryPredicate} always takes the first iterator's \tcode{value_type} |
181 | 181 | as its first argument, that is, in those cases when \tcode{T value} |
182 | | -is part of the signature, it should work correctly in the construct |
183 | | -\tcode{binary_pred(*first1, value)} contextually converted to \tcode{bool}\iref{conv}. |
| 182 | +is part of the signature, |
| 183 | +the expression \tcode{binary_pred(*first1, value)} shall be well-formed and |
| 184 | +the type \tcode{decltype(binary_pred(*first1, value))} shall model |
| 185 | +\exposconcept{boolean-testable}. |
184 | 186 | \tcode{binary_pred} shall not apply any non-constant function |
185 | | -through the dereferenced iterators. |
| 187 | +through any of its arguments. |
186 | 188 | Given a glvalue \tcode{u} of type (possibly \keyword{const}) \tcode{T1} |
187 | 189 | that designates the same object as \tcode{*first1}, and |
188 | 190 | a glvalue \tcode{v} of type (possibly \keyword{const}) \tcode{T2} |
|
6569 | 6571 | named \tcode{BinaryPredicate}~\iref{algorithms.requirements}. |
6570 | 6572 | The return value of the function call operation |
6571 | 6573 | applied to an object of type \tcode{Compare}, |
6572 | | -when contextually converted to \tcode{bool}\iref{conv}, |
| 6574 | +when converted to \tcode{bool}, |
6573 | 6575 | yields \tcode{true} |
6574 | 6576 | if the first argument of the call is less than the second, and |
6575 | 6577 | \tcode{false} otherwise. |
|
0 commit comments