Topic: Clarifying std::strong_ordering and
Author: leni536@gmail.com
Date: Fri, 26 Oct 2018 05:20:40 -0700 (PDT)
Raw View
------=_Part_856_1811767248.1540556440812
Content-Type: multipart/alternative;
boundary="----=_Part_857_1404909989.1540556440812"
------=_Part_857_1404909989.1540556440812
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi,
I think the semantics of the strong_* return types for the starship=20
operator need some clarification for heterogeneous comparison. The proposed=
=20
"substitutability" semantics in P0515 R3 only works for homogeneous=20
comparison (i.e. for strong equality a =3D=3D b implies f(a) =3D=3D f(b) fo=
r every=20
function f).
I propose the following for strong equality semantics for heterogeneous=20
comparison:
For every a,b of type A and c of type B if a =3D=3D c and b =3D=3D c, then =
for=20
every function f f(a) =3D=3D f(b). And for every x of type A and y,z of typ=
e B=20
if x =3D=3D y and x =3D=3D z, then for every function g g(y)=3D=3Dg(z).
One example of strong comparison between different types is case sensitive=
=20
string comparison between different string types. Maybe others can come up=
=20
with other examples.
Best regards,
L=C3=A9n=C3=A1rd Szolnoki
--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@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.or=
g.
------=_Part_857_1404909989.1540556440812
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi,</div><div><br></div><div>I think the semantics of=
the strong_* return types for the starship operator need some clarificatio=
n for heterogeneous comparison. The proposed "substitutability" s=
emantics in P0515 R3 only works for homogeneous comparison (i.e. for strong=
equality a =3D=3D b implies f(a) =3D=3D f(b) for every function f).</div><=
div><br></div><div>I propose the following for strong equality semantics fo=
r heterogeneous comparison:</div><div><br></div><div>For every a,b of type =
A and c of type B if a =3D=3D c and b =3D=3D c, then for every function f f=
(a) =3D=3D f(b). And for every x of type A and y,z of type B if x =3D=3D y =
and x =3D=3D z, then for every function g g(y)=3D=3Dg(z).</div><div><br></d=
iv><div>One example of strong comparison between different types is case se=
nsitive string comparison between different string types. Maybe others can =
come up with other examples.<br></div><div><br></div><div>Best regards,</di=
v><div>L=C3=A9n=C3=A1rd Szolnoki<br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/ef8c3389-636e-4fe6-b654-973ef10b2bde%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ef8c3389-636e-4fe6-b654-973ef10b2bde=
%40isocpp.org</a>.<br />
------=_Part_857_1404909989.1540556440812--
------=_Part_856_1811767248.1540556440812--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Fri, 26 Oct 2018 08:59:40 -0400
Raw View
--000000000000937cfd0579214b0e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Fri, Oct 26, 2018 at 8:20 AM <leni536@gmail.com> wrote:
> Hi,
>
> I think the semantics of the strong_* return types for the starship
> operator need some clarification for heterogeneous comparison. The propos=
ed
> "substitutability" semantics in P0515 R3 only works for homogeneous
> comparison (i.e. for strong equality a =3D=3D b implies f(a) =3D=3D 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 =3D=3D c and b =3D=3D c, the=
n for
> every function f f(a) =3D=3D f(b). And for every x of type A and y,z of t=
ype B
> if x =3D=3D y and x =3D=3D z, then for every function g g(y)=3D=3Dg(z).
>
>
Does that definition work well if A is CaseINsensitiveString and B is
string?
What about vice-versa?
Concepts uses a different definition (see EqualityComparableWith, and note
for concepts, there is only *strong* equality, it never deals with weak
equality).
The Concepts definition is basically find a common-type between A and B,
call it C. Every a,b,c,...x,y,z of A and B are converted to C (ie via
constructor) and then =3D=3D is done via C.
If C's =3D=3D is strong, than A =3D=3D B is strong.
This also follows the idea that a type is an attempt to model some _value_,
where the true value often outside of C++. Like int models numbers. Like
all date classes attempt to model the external concept of "date". So
MyDateClass and YourDateClass are equal when they both refer to the same
external date.
The only question for the common-type definition is whether the common type
needs to really exist in C++, or does it just need to theoretically exist.
Do we need a CommonDate type to do MyDate =3D=3D YourDate, or is it enough =
that
they refer to the same "platonic" date ideal.
One example of strong comparison between different types is case sensitive
> string comparison between different string types. Maybe others can come u=
p
> with other examples.
>
> Best regards,
> L=C3=A9n=C3=A1rd 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+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ef8c3389-636=
e-4fe6-b654-973ef10b2bde%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ef8c3389-63=
6e-4fe6-b654-973ef10b2bde%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>
--=20
Be seeing you,
Tony
--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAOHCbiu9RN_3Hc9jyu5YyBPUJSQuWJ%2B3UL32ud9VC4BAM=
q1JwA%40mail.gmail.com.
--000000000000937cfd0579214b0e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Fri=
, Oct 26, 2018 at 8:20 AM <<a href=3D"mailto:leni536@gmail.com">leni536@=
gmail.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><div>Hi,</div><div><br></div><div>I think the semantics of the str=
ong_* return types for the starship operator need some clarification for he=
terogeneous comparison. The proposed "substitutability" semantics=
in P0515 R3 only works for homogeneous comparison (i.e. for strong equalit=
y a =3D=3D b implies f(a) =3D=3D f(b) for every function f).</div><div><br>=
</div><div>I propose the following for strong equality semantics for hetero=
geneous comparison:</div><div><br></div><div>For every a,b of type A and c =
of type B if a =3D=3D c and b =3D=3D c, then for every function f f(a) =3D=
=3D f(b). And for every x of type A and y,z of type B if x =3D=3D y and x =
=3D=3D z, then for every function g g(y)=3D=3Dg(z).</div><div><br></div></d=
iv></blockquote><div><br></div><div>Does that definition work well if A is =
CaseINsensitiveString and B is string?<br></div><div>What about vice-versa?=
</div><div><br></div><div>Concepts uses a different definition (see Equalit=
yComparableWith, and note for concepts, there is only *strong* equality, it=
never deals with weak equality).</div><div><br></div><div>The Concepts def=
inition is basically find a common-type between A and B, call it C.=C2=A0 E=
very a,b,c,...x,y,z of A and B are converted to C (ie via constructor) and =
then =3D=3D is done via C.</div><div>If C's =3D=3D is strong, than A =
=3D=3D B is strong.</div><div><br></div><div>This also follows the idea tha=
t a type is an attempt to model some _value_, where the true value often ou=
tside of C++.=C2=A0 Like int models numbers.=C2=A0 Like all date classes at=
tempt to model the external concept of "date".=C2=A0 So MyDateCla=
ss and YourDateClass are equal when they both refer to the same external da=
te.</div><div><br></div><div>The only question for the common-type definiti=
on is whether the common type needs to really exist in C++, or does it just=
need to theoretically exist.=C2=A0 Do we need a CommonDate type to do MyDa=
te =3D=3D YourDate, or is it enough that they refer to the same "plato=
nic" date ideal.<br></div><div><br></div><div><br></div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=
adding-left:1ex"><div dir=3D"ltr"><div></div><div>One example of strong com=
parison between different types is case sensitive string comparison between=
different string types. Maybe others can come up with other examples.<br><=
/div><div><br></div><div>Best regards,</div><div>L=C3=A9n=C3=A1rd Szolnoki<=
br></div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/ef8c3389-636e-4fe6-b654-973ef10b2bde%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ef8c3389-636e-=
4fe6-b654-973ef10b2bde%40isocpp.org</a>.<br>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div>Be=
seeing you,<br></div>Tony<br></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAOHCbiu9RN_3Hc9jyu5YyBPUJSQuWJ%2B3UL=
32ud9VC4BAMq1JwA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOHCbiu9RN_3Hc=
9jyu5YyBPUJSQuWJ%2B3UL32ud9VC4BAMq1JwA%40mail.gmail.com</a>.<br />
--000000000000937cfd0579214b0e--
.
Author: leni536@gmail.com
Date: Fri, 26 Oct 2018 07:27:59 -0700 (PDT)
Raw View
------=_Part_89_962755450.1540564079292
Content-Type: multipart/alternative;
boundary="----=_Part_90_1127429160.1540564079292"
------=_Part_90_1127429160.1540564079292
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi,
Does that definition work well if A is CaseINsensitiveString and B is=20
> string?
> What about vice-versa?
>
Assuming CaseInsensitiveString has strong equality with itself and you want=
=20
operator=3D=3D(CaseInsensitiveString, string) be case insensitive then yes,=
you=20
can't return with strong_equality? Return with weak_equality in this case.=
=20
Would CaseInsensitiveString and string even satisfy EqualityComparableWith?
I think it's strange that the definition of EqualityComparableWith needs a=
=20
third common type for comparison, it's absolutely not needed. The=20
common_reference requirements can be dropped and the following requirements=
=20
can be added:
EqualityComparableWith<T, U> is staisfied only if given
- a and b, lvalues of type=20
const std::remove_reference_t<T>
and
- x and y, lvalues of type
conststd::remove_reference_t<U>
=20
the following is true:
!(bool(a =3D=3D x) && bool(b =3D=3D y)) || !(bool(a=3D=3Db)^bool(x=3D=3Dy))
It's rather cryptic this way, but it basically says that the operator=3D=3D=
=20
between different types describes an isomorphism. No need for a common=20
type. Then again, maybe the users of EqualityComparableWith need the common=
=20
reference anyway and the above restriction can't be described in code.
Best regards,
L=C3=A9n=C3=A1rd
--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/380a6e1f-c61d-44be-becf-b4d583c7019e%40isocpp.or=
g.
------=_Part_90_1127429160.1540564079292
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi,</div><div><br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padd=
ing-left: 1ex;"><div dir=3D"ltr"><div class=3D"gmail_quote"><div>Does that =
definition work well if A is CaseINsensitiveString and B is string?<br></di=
v><div>What about vice-versa?</div></div></div></blockquote><div><br></div>=
<div>Assuming CaseInsensitiveString has strong equality with itself and you=
want operator=3D=3D(CaseInsensitiveString, string) be case insensitive the=
n yes, you can't return with strong_equality? Return with weak_equality=
in this case. Would CaseInsensitiveString and string even satisfy Equality=
ComparableWith?</div><div><br></div><div>I think it's strange that the =
definition of EqualityComparableWith needs a third common type for comparis=
on, it's absolutely not needed. The common_reference requirements can b=
e dropped and the following requirements can be added:</div><div><br></div>=
<div>EqualityComparableWith<T, U> is staisfied only if given</div><di=
v><ul><li>a and b, lvalues of type <div style=3D"background-color: rgb(250,=
250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-w=
idth: 1px; overflow-wrap: break-word;" class=3D"prettyprint"><code class=3D=
"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">const</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">remove_reference_t</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify"><</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">T</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">></span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
></span></div></code></div>and</li><li>x and y, lvalues of type<div style=
=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187);=
border-style: solid; border-width: 1px; overflow-wrap: break-word;" class=
=3D"prettyprint"><code class=3D"prettyprint"><div class=3D"subprettyprint">=
<span style=3D"color: #000;" class=3D"styled-by-prettify">conststd</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">remove_reference_t</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify"><</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">U</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">></span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br></span></div></code></div></li></ul>=
the following is true:</div><div><div style=3D"background-color: rgb(250, 2=
50, 250); border-color: rgb(187, 187, 187); border-style: solid; border-wid=
th: 1px; overflow-wrap: break-word;" class=3D"prettyprint"><code class=3D"p=
rettyprint"><div class=3D"subprettyprint"><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">!(</span><span style=3D"color: #008;" class=3D"sty=
led-by-prettify">bool</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">a </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> x</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">&&</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;"=
class=3D"styled-by-prettify">bool</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">b </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">=3D=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> y</span><span style=3D"color: #660;" class=3D"styled-by-prettify">))</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
style=3D"color: #660;" class=3D"styled-by-prettify">||</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">!(</span><span style=3D"color: #008;"=
class=3D"styled-by-prettify">bool</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">a</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">=3D=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">b</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)^</spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">bool</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">x</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">=3D=3D</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">y</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">))</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br></span></div></code></div><br>It's rather cryptic =
this way, but it basically says that the operator=3D=3D between different t=
ypes describes an isomorphism. No need for a common type. Then again, maybe=
the users of EqualityComparableWith need the common reference anyway and t=
he above restriction can't be described in code.</div><div><br></div><d=
iv>Best regards,</div><div>L=C3=A9n=C3=A1rd<br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/380a6e1f-c61d-44be-becf-b4d583c7019e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/380a6e1f-c61d-44be-becf-b4d583c7019e=
%40isocpp.org</a>.<br />
------=_Part_90_1127429160.1540564079292--
------=_Part_89_962755450.1540564079292--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Fri, 26 Oct 2018 11:02:43 -0700
Raw View
On Friday, 26 October 2018 05:20:40 PDT leni536@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-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@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.
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Fri, 26 Oct 2018 18:59:48 -0400
Raw View
--000000000000d13b0a057929adeb
Content-Type: text/plain; charset="UTF-8"
On Fri, Oct 26, 2018 at 2:02 PM Thiago Macieira <thiago@macieira.org> wrote:
> On Friday, 26 October 2018 05:20:40 PDT leni536@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?
>
Yes it does. You need to bring in the idea of "salient" attributes. See
Lakos http://wg21.link/N2479
Basically, address is not a salient part of the _value_ of string.
> --
> 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-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@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
> .
>
--
Be seeing you,
Tony
--
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+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOHCbiuGJrBGM1ZSPADX7L7NMyyJEbn2iD3pxjxPM9Ha9vWnmQ%40mail.gmail.com.
--000000000000d13b0a057929adeb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div d=
ir=3D"ltr">On Fri, Oct 26, 2018 at 2:02 PM Thiago Macieira <<a href=3D"m=
ailto:thiago@macieira.org">thiago@macieira.org</a>> wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex">On Friday, 26 October 2018 05=
:20:40 PDT <a href=3D"mailto:leni536@gmail.com" target=3D"_blank">leni536@g=
mail.com</a> wrote:<br>
> I think the semantics of the strong_* return types for the starship<br=
>
> operator need some clarification for heterogeneous comparison. The pro=
posed<br>
> "substitutability" semantics in P0515 R3 only works for homo=
geneous<br>
> comparison (i.e. for strong equality a =3D=3D b implies f(a) =3D=3D f(=
b) for every<br>
> function f).<br>
<br>
A simple f that breaks for std::string:<br>
<br>
const char *f(const std::string &s)<br>
{<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return s.c_str();<br>
}<br>
<br>
Two strings may be equal and yet have different data pointer addresses.<br>
<br>
Does this mean "f" needs qualification too?<br></blockquote><div>=
<br></div><div>Yes it does.=C2=A0 You need to bring in the idea of "sa=
lient" attributes.=C2=A0 See Lakos <a href=3D"http://wg21.link/N2479">=
http://wg21.link/N2479</a></div><div>Basically, address is not a salient pa=
rt of the _value_ of string.</div><div><br></div><div><br></div><blockquote=
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex">
<br>
-- <br>
Thiago Macieira - thiago (AT) <a href=3D"http://macieira.info" rel=3D"noref=
errer" target=3D"_blank">macieira.info</a> - thiago (AT) <a href=3D"http://=
kde.org" rel=3D"noreferrer" target=3D"_blank">kde.org</a><br>
=C2=A0 =C2=A0Software Architect - Intel Open Source Technology Center<br>
<br>
<br>
<br>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/35072227.GUJPt0TEoj%40tjmaciei-mobl1"=
rel=3D"noreferrer" target=3D"_blank">https://groups.google.com/a/isocpp.or=
g/d/msgid/std-proposals/35072227.GUJPt0TEoj%40tjmaciei-mobl1</a>.<br>
</blockquote></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" class=3D"g=
mail_signature"><div dir=3D"ltr"><div>Be seeing you,<br></div>Tony<br></div=
></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAOHCbiuGJrBGM1ZSPADX7L7NMyyJEbn2iD3p=
xjxPM9Ha9vWnmQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOHCbiuGJrBGM1ZS=
PADX7L7NMyyJEbn2iD3pxjxPM9Ha9vWnmQ%40mail.gmail.com</a>.<br />
--000000000000d13b0a057929adeb--
.