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
--
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-proposal...@isocpp.org.
To post to this group, send email to std-pr...@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.
Does that definition work well if A is CaseINsensitiveString and B is string?What about vice-versa?
const std::remove_reference_t<T>
conststd::remove_reference_t<U>
!(bool(a == x) && bool(b == y)) || !(bool(a==b)^bool(x==y))
On Friday, 26 October 2018 05:20:40 PDT len...@gmail.com wrote:
> 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).
A simple f that breaks for std::string:
const char *f(const std::string &s)
{
return s.c_str();
}
Two strings may be equal and yet have different data pointer addresses.
Does this mean "f" needs qualification too?
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
--
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-proposal...@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/35072227.GUJPt0TEoj%40tjmaciei-mobl1.