Created on 2018-08-10.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4762.
Modify [concept.commonref] p2 as follows:
-2- Let C be common_reference_t<T, U>. Let
t be a function whose return type ist1 and t2 be equality-preserving expressions ([concepts.equality]) such that decltype((t1)) and decltype((t2)) are each T, and letu be a function whose return type isu1 and u2 be equality-preserving expressions such that decltype((u1)) and decltype((u2)) are each U. T and U model CommonReference<T, U>is satisfiedonly if:(2.1) — C(t1
()) equals C(t2()) if and only if t1()equals t2, andis an equality-preserving expression ([concepts.equality]).(2.2) — C(u1
()) equals C(u2()) if and only if u1()equals u2is an equality-preserving expression.
Modify [concept.common] p2 similarly:
-2- Let C be common_type_t<T, U>. Let
t be a function whose return type ist1 and t2 be equality-preserving expressions ([concepts.equality]) such that decltype((t1)) and decltype((t2)) are each T, and letu be a function whose return type isu1 and u2 be equality-preserving expressions such that decltype((u1)) and decltype((u2)) are each U. T and U model Common<T, U>is satisfiedonly if:(2.1) — C(t1
()) equals C(t2()) if and only if t1()equals t2, andis an equality-preserving expression ([concepts.equality]).(2.2) — C(u1
()) equals C(u2()) if and only if u1()equals u2is an equality-preserving expression ([concepts.equality]).
[ 2018-11, Adopted in San Diego ]
[ 2018-08 Batavia Monday issue prioritization ]
Priority set to 0, status to 'Tentatively Ready'
The semantic requirements of both Common ([concept.common]):
-2- Let C be common_type_t<T, U>. Let t be a function whose return type is T, and let u be a function whose return type is U. Common<T, U> is satisfied only if:
(2.1) — C(t()) equals C(t()) if and only if t() is an equality-preserving expression ([concepts.equality]).
(2.2) — C(u()) equals C(u()) if and only if u() is an equality-preserving expression ([concepts.equality]).
and similarly CommonReference ([concept.commonreference]):
-2- Let C be common_reference_t<T, U>. Let t be a function whose return type is T, and let u be a function whose return type is U. CommonReference<T, U> is satisfied only if:
(2.1) — C(t()) equals C(t()) if and only if t() is an equality-preserving expression ([concepts.equality]).
(2.2) — C(u()) equals C(u()) if and only if u() is an equality-preserving expression.
don't properly reflect the intended design that conversions to the common type / common reference type are identity-preserving: in other words, that converting two values to the common type produces equal results if and only if the values were initially equal. The phrasing "C(E) equals C(E) if and only if E is an equality-preserving expression" is also clearly defective regardless of the intended design: the assertion "E is not equality-preserving" does not imply that every evaluation of E produces different results.
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2018-11-12 04:39:29 | admin | set | messages: + msg10208 |
2018-11-12 04:39:29 | admin | set | status: voting -> wp |
2018-10-08 05:13:59 | admin | set | status: ready -> voting |
2018-08-22 12:55:05 | admin | set | messages: + msg10101 |
2018-08-22 12:55:05 | admin | set | status: new -> ready |
2018-08-13 22:37:52 | admin | set | messages: + msg10065 |
2018-08-10 00:00:00 | admin | create |