l***@gmail.com
2018-10-26 12:20:40 UTC
Hi,
I think the semantics of the strong_* return types for the starship
operator need some clarification for heterogeneous comparison. The proposed
"substitutability" semantics in P0515 R3 only works for homogeneous
comparison (i.e. for strong equality a == b implies f(a) == f(b) for every
function f).
I propose the following for strong equality semantics for heterogeneous
comparison:
For every a,b of type A and c of type B if a == c and b == c, then for
every function f f(a) == f(b). And for every x of type A and y,z of type B
if x == y and x == z, then for every function g g(y)==g(z).
One example of strong comparison between different types is case sensitive
string comparison between different string types. Maybe others can come up
with other examples.
Best regards,
Lénárd Szolnoki
I think the semantics of the strong_* return types for the starship
operator need some clarification for heterogeneous comparison. The proposed
"substitutability" semantics in P0515 R3 only works for homogeneous
comparison (i.e. for strong equality a == b implies f(a) == f(b) for every
function f).
I propose the following for strong equality semantics for heterogeneous
comparison:
For every a,b of type A and c of type B if a == c and b == c, then for
every function f f(a) == f(b). And for every x of type A and y,z of type B
if x == y and x == z, then for every function g g(y)==g(z).
One example of strong comparison between different types is case sensitive
string comparison between different string types. Maybe others can come up
with other examples.
Best regards,
Lénárd Szolnoki
--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+***@isocpp.org.
To post to this group, send email to std-***@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ef8c3389-636e-4fe6-b654-973ef10b2bde%40isocpp.org.
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+***@isocpp.org.
To post to this group, send email to std-***@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ef8c3389-636e-4fe6-b654-973ef10b2bde%40isocpp.org.