There is another unclear phrase in the C++ 20 Standard relative to comparison operators.
«3 The return value V of a defaulted == operator function with parameters x and y is determined by comparing corresponding elements xi and yi in the expanded lists of subobjects for x and y (in increasing index order) until the first index i where xi == yi yields a result value which, when contextually converted to bool, yields false. If no such index exists, V is true. Otherwise, V is false.»
What does the last statement « Otherwise, V is false.»» mean?
Does it mean a case when two expanded lists are unequal or something else?
In any case a code example of such «otherwise» along with the example of a trivial comparison that follows would be useful to make the statement more clear.
With best regards
(Vlad from Moscow)
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
Понедельник, 19 декабря 2022, 14:33 +03:00 от Edward Catmur via Std-Discussion <email@example.com>:
Can anybody translate this phrase from the C++ 20 Standard
«Name lookups in the defaulted definition of a comparison operator function are performed from a context equivalent to its function-body.»
to the human language?
How can a context be equivalent to a function body? They are two different notions.
A context equivalent to the context of the function body.