Topic: RelOps
Author: Douglas Boffey <douglas.boffey@gmail.com>
Date: Tue, 3 Mar 2015 04:17:27 -0800 (PST)
Raw View
------=_Part_4752_1477559873.1425385047028
Content-Type: multipart/alternative;
boundary="----=_Part_4753_1995375250.1425385047028"
------=_Part_4753_1995375250.1425385047028
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Consider the expression:
=20
E1 R1 E2 =E2=80=A6 E*n* =E2=80=93 1 R*n* =E2=80=93 1 E*n*
=20
where E*i* (1 =E2=89=A4 *i* =E2=89=A4 *n*) are sub-expressions, and R*i* (1=
=E2=89=A4 *i* < *n*)=20
are relational operators, namely one of =E2=80=98<=E2=80=99, =E2=80=98<=3D=
=E2=80=99, =E2=80=98>=E2=80=99, =E2=80=98>=3D=E2=80=99, =E2=80=98=3D=3D=E2=
=80=98 or =E2=80=98!=3D=E2=80=99.
=20
If the result of evaluating Ei Ri Ei + 1 would naturally resolve to a type=
=20
that implicitly coerces to a bool, it would be preferable to expand this=20
into the following:
=20
auto T2 =3D E2; =20
if (!(E1 R1 T2)) goto false_part; =20
auto T3 =3D E3; =20
if (!(T2 R2 T3)) goto false_part; =20
// =E2=80=A6 =20
auto T*n* =E2=80=93 1 =3D E*n* =E2=80=93 1; =20
if (!(T*n* =E2=80=93 2 R*n* =E2=80=93 2 T*n* =E2=80=93 1)) goto false_part;=
=20
=20
expr =3D (T*n* =E2=80=93 1 R*n* =E2=80=93 1 E*n*); =
=20
goto over; =20
false_part: =20
expr =3D false; =20
over: =20
=20
=20
where the T*i* (1 < *i* < *n*) are compiler-generated values and expr will=
=20
be the result of the full expression.
=20
I know this is a breaking expression, but how many lines of code are there=
=20
that this would break (where the intention of the programmer was correct, I=
=20
mean)?
=20
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_4753_1995375250.1425385047028
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><FONT c=
olor=3D#000000 size=3D3 face=3D"Times New Roman">Consider the expression:</=
FONT></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><?xml:namespace prefix =
=3D o ns =3D "urn:schemas-microsoft-com:office:office" /><o:p><FONT color=
=3D#000000 size=3D3 face=3D"Times New Roman"> </FONT></o:p></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><FONT color=3D#000000><F=
ONT face=3D"Times New Roman"><FONT size=3D3><SPAN style=3D"mso-tab-count: 1=
"> </SPAN=
>E</FONT><SUB><FONT size=3D2>1</FONT></SUB><FONT size=3D3> R</FONT><SUB><FO=
NT size=3D2>1</FONT></SUB><FONT size=3D3> E</FONT><SUB><FONT size=3D2>2</FO=
NT></SUB><FONT size=3D3> =E2=80=A6 E</FONT><FONT size=3D2><I style=3D"mso-b=
idi-font-style: normal"><SUB>n</SUB></I><SUB> =E2=80=93 1</SUB></FONT><FONT=
size=3D3> R</FONT><FONT size=3D2><I style=3D"mso-bidi-font-style: normal">=
<SUB>n</SUB></I><SUB> =E2=80=93 1</SUB></FONT><FONT size=3D3> E</FONT><I st=
yle=3D"mso-bidi-font-style: normal"><SUB><FONT size=3D2>n</FONT></SUB></I><=
/FONT></FONT></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><o:p><FONT color=3D#0000=
00 size=3D3 face=3D"Times New Roman"> </FONT></o:p></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><FONT color=3D#000000><F=
ONT face=3D"Times New Roman"><FONT size=3D3>where E</FONT><I style=3D"mso-b=
idi-font-style: normal"><SUB><FONT size=3D2>i</FONT></SUB></I><FONT size=3D=
3> (1 =E2=89=A4 <I style=3D"mso-bidi-font-style: normal">i</I> =E2=89=A4 <I=
style=3D"mso-bidi-font-style: normal">n</I>) are sub-expressions, and R</F=
ONT><I style=3D"mso-bidi-font-style: normal"><SUB><FONT size=3D2>i</FONT></=
SUB></I><FONT size=3D3> (1 =E2=89=A4 <I style=3D"mso-bidi-font-style: norma=
l">i</I> < <I style=3D"mso-bidi-font-style: normal">n</I>) are relationa=
l operators, namely one of =E2=80=98<=E2=80=99, =E2=80=98<=3D=E2=80=
=99, =E2=80=98>=E2=80=99, =E2=80=98>=3D=E2=80=99, =E2=80=98=3D=3D=E2=
=80=98 or =E2=80=98!=3D=E2=80=99.</FONT></FONT></FONT></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><o:p><FONT color=3D#0000=
00 size=3D3 face=3D"Times New Roman"> </FONT></o:p></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><FONT color=3D#000000><F=
ONT face=3D"Times New Roman"><FONT size=3D3>If the result of evaluating E</=
FONT><SUB><FONT size=3D2>i</FONT></SUB><FONT size=3D3> R</FONT><SUB><FONT s=
ize=3D2>i</FONT></SUB><FONT size=3D3> E</FONT><SUB><FONT size=3D2>i + 1</FO=
NT></SUB><FONT size=3D3> would naturally resolve to a type that implicitly =
coerces to a bool, it would be preferable to expand this into the following=
:</FONT></FONT></FONT></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><o:p><FONT color=3D#0000=
00 size=3D3 face=3D"Times New Roman"> </FONT></o:p></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><FONT color=3D#000000><F=
ONT face=3D"Times New Roman"><FONT size=3D3></FONT></FONT></FONT></P>
<DIV style=3D"BORDER-BOTTOM: #bbb 1px solid; BORDER-LEFT: #bbb 1px solid; B=
ACKGROUND-COLOR: #fafafa; WORD-WRAP: break-word; BORDER-TOP: #bbb 1px solid=
; BORDER-RIGHT: #bbb 1px solid" class=3Dprettyprint><CODE class=3Dprettypri=
nt>
<DIV class=3Dsubprettyprint><SPAN style=3D"COLOR: #008" class=3Dstyled-by-p=
rettify>auto</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> =
T</SPAN><FONT size=3D1><SPAN style=3D"COLOR: #000" class=3Dstyled-by-pretti=
fy>2</SPAN></FONT><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> <=
/SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>=3D</SPAN><SPA=
N style=3D"COLOR: #000" class=3Dstyled-by-prettify> E</SPAN><FONT size=3D1>=
<SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify>2</SPAN></FONT><SPAN=
style=3D"COLOR: #660" class=3Dstyled-by-prettify>;</SPAN><SPAN style=3D"CO=
LOR: #000" class=3Dstyled-by-prettify> &=
nbsp; <BR></SPAN><SP=
AN style=3D"COLOR: #008" class=3Dstyled-by-prettify>if</SPAN><SPAN style=3D=
"COLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #660=
" class=3Dstyled-by-prettify>(!(</SPAN><SPAN style=3D"COLOR: #000" class=3D=
styled-by-prettify>E</SPAN><FONT size=3D1><SPAN style=3D"COLOR: #000" class=
=3Dstyled-by-prettify>1</SPAN></FONT><SPAN style=3D"COLOR: #000" class=3Dst=
yled-by-prettify> R</SPAN><FONT size=3D1><SPAN style=3D"COLOR: #000" class=
=3Dstyled-by-prettify>1</SPAN></FONT><SPAN style=3D"COLOR: #000" class=3Dst=
yled-by-prettify> T</SPAN><FONT size=3D1><SPAN style=3D"COLOR: #000" class=
=3Dstyled-by-prettify>2</SPAN></FONT><SPAN style=3D"COLOR: #660" class=3Dst=
yled-by-prettify>))</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-pre=
ttify> </SPAN><SPAN style=3D"COLOR: #008" class=3Dstyled-by-prettify>goto</=
SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> false_part</SP=
AN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>;</SPAN><SPAN sty=
le=3D"COLOR: #000" class=3Dstyled-by-prettify> =
<BR></=
SPAN><SPAN style=3D"COLOR: #008" class=3Dstyled-by-prettify>auto</SPAN><SPA=
N style=3D"COLOR: #000" class=3Dstyled-by-prettify> T</SPAN><FONT size=3D1>=
<SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify>3</SPAN></FONT><SPAN=
style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"CO=
LOR: #660" class=3Dstyled-by-prettify>=3D</SPAN><SPAN style=3D"COLOR: #000"=
class=3Dstyled-by-prettify> E</SPAN><FONT size=3D1><SPAN style=3D"COLOR: #=
000" class=3Dstyled-by-prettify>3</SPAN></FONT><SPAN style=3D"COLOR: #660" =
class=3Dstyled-by-prettify>;</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyl=
ed-by-prettify> &nb=
sp; <BR></SPAN><SPAN style=3D"COLOR: #008=
" class=3Dstyled-by-prettify>if</SPAN><SPAN style=3D"COLOR: #000" class=3Ds=
tyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-pre=
ttify>(!(</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify>T</S=
PAN><FONT size=3D1><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify>2=
</SPAN></FONT><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> R</SP=
AN><FONT size=3D1><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify>2<=
/SPAN></FONT><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> T</SPA=
N><FONT size=3D1><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify>3</=
SPAN></FONT><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>))</SPAN=
><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=
=3D"COLOR: #008" class=3Dstyled-by-prettify>goto</SPAN><SPAN style=3D"COLOR=
: #000" class=3Dstyled-by-prettify> false_part</SPAN><SPAN style=3D"COLOR: =
#660" class=3Dstyled-by-prettify>;</SPAN><SPAN style=3D"COLOR: #000" class=
=3Dstyled-by-prettify> &nb=
sp; <BR></SPAN><SPAN style=3D"COLO=
R: #800" class=3Dstyled-by-prettify>// =E2=80=A6  =
; </SPAN><SP=
AN style=3D"COLOR: #000" class=3Dstyled-by-prettify> <BR></SPAN><SPAN =
style=3D"COLOR: #008" class=3Dstyled-by-prettify>auto</SPAN><SPAN style=3D"=
COLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #606"=
class=3Dstyled-by-prettify>T</SPAN><FONT size=3D1><EM><SPAN style=3D"COLOR=
: #606" class=3Dstyled-by-prettify>n</SPAN></EM></FONT><FONT size=3D1><SPAN=
style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"CO=
LOR: #660" class=3Dstyled-by-prettify>=E2=80=93</SPAN><SPAN style=3D"COLOR:=
#000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #066" class=
=3Dstyled-by-prettify>1</SPAN></FONT><SPAN style=3D"COLOR: #000" class=3Dst=
yled-by-prettify> </SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-pret=
tify>=3D</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SP=
AN><SPAN style=3D"COLOR: #606" class=3Dstyled-by-prettify>E</SPAN><FONT siz=
e=3D1><EM><SPAN style=3D"COLOR: #606" class=3Dstyled-by-prettify>n</SPAN></=
EM></FONT><FONT size=3D1><SPAN style=3D"COLOR: #000" class=3Dstyled-by-pret=
tify> </SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>=E2=80=
=93</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SPAN><S=
PAN style=3D"COLOR: #066" class=3Dstyled-by-prettify>1</SPAN></FONT><SPAN s=
tyle=3D"COLOR: #660" class=3Dstyled-by-prettify>;</SPAN><SPAN style=3D"COLO=
R: #000" class=3Dstyled-by-prettify> &nb=
sp; <BR></SPAN><SPAN=
style=3D"COLOR: #008" class=3Dstyled-by-prettify>if</SPAN><SPAN style=3D"C=
OLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #660" =
class=3Dstyled-by-prettify>(!(</SPAN><SPAN style=3D"COLOR: #606" class=3Dst=
yled-by-prettify>T</SPAN><FONT size=3D1><EM><SPAN style=3D"COLOR: #606" cla=
ss=3Dstyled-by-prettify>n</SPAN></EM></FONT><FONT size=3D1><SPAN style=3D"C=
OLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #660" =
class=3Dstyled-by-prettify>=E2=80=93</SPAN><SPAN style=3D"COLOR: #000" clas=
s=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #066" class=3Dstyled-b=
y-prettify>2</SPAN></FONT><SPAN style=3D"COLOR: #000" class=3Dstyled-by-pre=
ttify> </SPAN><SPAN style=3D"COLOR: #606" class=3Dstyled-by-prettify>R</SPA=
N><FONT size=3D1><EM><SPAN style=3D"COLOR: #606" class=3Dstyled-by-prettify=
>n</SPAN></EM></FONT><FONT size=3D1><SPAN style=3D"COLOR: #000" class=3Dsty=
led-by-prettify> </SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prett=
ify>=E2=80=93</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify>=
</SPAN><SPAN style=3D"COLOR: #066" class=3Dstyled-by-prettify>2</SPAN></FO=
NT><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN sty=
le=3D"COLOR: #606" class=3Dstyled-by-prettify>T</SPAN><FONT size=3D1><EM><S=
PAN style=3D"COLOR: #606" class=3Dstyled-by-prettify>n</SPAN></EM></FONT><F=
ONT size=3D1><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SPAN=
><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>=E2=80=93</SPAN><SP=
AN style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"=
COLOR: #066" class=3Dstyled-by-prettify>1</SPAN></FONT><SPAN style=3D"COLOR=
: #660" class=3Dstyled-by-prettify>))</SPAN><SPAN style=3D"COLOR: #000" cla=
ss=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #008" class=3Dstyled-=
by-prettify>goto</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-pretti=
fy> false_part</SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify=
>;</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> &nb=
sp; &=
nbsp; <BR>expr </SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-p=
rettify>=3D</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> <=
/SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>(</SPAN><SPAN =
style=3D"COLOR: #606" class=3Dstyled-by-prettify>T</SPAN><FONT size=3D1><EM=
><SPAN style=3D"COLOR: #606" class=3Dstyled-by-prettify>n</SPAN></EM></FONT=
><FONT size=3D1><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> </S=
PAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>=E2=80=93</SPAN>=
<SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=
=3D"COLOR: #066" class=3Dstyled-by-prettify>1</SPAN></FONT><SPAN style=3D"C=
OLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #606" =
class=3Dstyled-by-prettify>R</SPAN><FONT size=3D1><EM><SPAN style=3D"COLOR:=
#606" class=3Dstyled-by-prettify>n</SPAN></EM></FONT><FONT size=3D1><SPAN =
style=3D"COLOR: #000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COL=
OR: #660" class=3Dstyled-by-prettify>=E2=80=93</SPAN><SPAN style=3D"COLOR: =
#000" class=3Dstyled-by-prettify> </SPAN><SPAN style=3D"COLOR: #066" class=
=3Dstyled-by-prettify>1</SPAN></FONT><SPAN style=3D"COLOR: #000" class=3Dst=
yled-by-prettify> </SPAN><SPAN style=3D"COLOR: #606" class=3Dstyled-by-pret=
tify>E</SPAN><FONT size=3D1><EM><SPAN style=3D"COLOR: #606" class=3Dstyled-=
by-prettify>n</SPAN></EM></FONT><SPAN style=3D"COLOR: #660" class=3Dstyled-=
by-prettify>);</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify=
> &nb=
sp; <BR></SPAN><SPAN style=3D"COLOR: #008" class=3Dstyl=
ed-by-prettify>goto</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-pre=
ttify> over</SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>;<=
/SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> =
&nbs=
p; <BR>false_part</SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by=
-prettify>:</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> &=
nbsp; =
<BR>expr </SPAN><SPAN style=3D"COLOR: #660" class=3Dst=
yled-by-prettify>=3D</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-pr=
ettify> </SPAN><SPAN style=3D"COLOR: #008" class=3Dstyled-by-prettify>false=
</SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>;</SPAN><SPAN=
style=3D"COLOR: #000" class=3Dstyled-by-prettify> &nb=
sp; <B=
R>over</SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>:</SPAN=
><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> &nbs=
p; &nb=
sp;<BR>  =
; <BR> =
<BR></SPAN></DIV></C=
ODE></DIV><BR>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><FONT color=3D#000000><F=
ONT face=3D"Times New Roman"><FONT size=3D3>where the T</FONT><I style=3D"m=
so-bidi-font-style: normal"><SUB><FONT size=3D2>i</FONT></SUB></I><FONT siz=
e=3D3> (1 < <I style=3D"mso-bidi-font-style: normal">i</I> < <I style=
=3D"mso-bidi-font-style: normal">n</I>) are compiler-generated values and e=
xpr will be the result of the full expression.</FONT></FONT></FONT></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><o:p><FONT color=3D#0000=
00 size=3D3 face=3D"Times New Roman"> </FONT></o:p></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><FONT color=3D#000000 si=
ze=3D3 face=3D"Times New Roman">I know this is a breaking expression, but h=
ow many lines of code are there that this would break (where the intention =
of the programmer was correct, I mean)?</FONT></P>
<P style=3D"MARGIN: 0cm 0cm 0pt" class=3DMsoNormal><SPAN style=3D"mso-space=
run: yes"><FONT color=3D#000000 size=3D3 face=3D"Times New Roman"> </=
FONT></SPAN></P></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_4753_1995375250.1425385047028--
------=_Part_4752_1477559873.1425385047028--
.
Author: Yuriy Smirnov <neoprogramming@gmail.com>
Date: Tue, 3 Mar 2015 06:17:44 -0800 (PST)
Raw View
------=_Part_406_1919597451.1425392264563
Content-Type: multipart/alternative;
boundary="----=_Part_407_1027530076.1425392264563"
------=_Part_407_1027530076.1425392264563
Content-Type: text/plain; charset=UTF-8
If I understand you correctly, you want to use expressions like this?
if(x1 > x2 > x3 > x4) {} // if(x1>x2 && x2>x3 && x3>x4) {}
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_407_1027530076.1425392264563
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">If I understand you correctly, you want to use expressions=
like this?<div><br><div><div class=3D"prettyprint" style=3D"border: 1px so=
lid rgb(187, 187, 187); word-wrap: break-word; background-color: rgb(250, 2=
50, 250);"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span =
style=3D"color: #008;" class=3D"styled-by-prettify">if</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">x1 </span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">></span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> x2 </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">></span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> x3 </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">></span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
x4</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">{}</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #80=
0;" class=3D"styled-by-prettify">// if(x1>x2 && x2>x3 &&a=
mp; x3>x4) {}</span></div></code></div><span class=3D"styled-by-prettify=
" style=3D"font-family: monospace; color: rgb(136, 0, 0); background-color:=
rgb(250, 250, 250);"><div><span class=3D"styled-by-prettify" style=3D"font=
-family: monospace; color: rgb(136, 0, 0); background-color: rgb(250, 250, =
250);"><br></span></div><div><br></div></span></div><div><br></div><div><br=
></div><div><br></div><div><br></div></div></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_407_1027530076.1425392264563--
------=_Part_406_1919597451.1425392264563--
.
Author: Scott Prager <splinterofchaos@gmail.com>
Date: Tue, 3 Mar 2015 10:41:15 -0800 (PST)
Raw View
------=_Part_393_1178801549.1425408075086
Content-Type: multipart/alternative;
boundary="----=_Part_394_1580990468.1425408075086"
------=_Part_394_1580990468.1425408075086
Content-Type: text/plain; charset=UTF-8
On Tuesday, March 3, 2015 at 9:17:44 AM UTC-5, Yuriy Smirnov wrote:
>
> If I understand you correctly, you want to use expressions like this?
>
> if(x1 > x2 > x3 > x4) {} // if(x1>x2 && x2>x3 && x3>x4) {}
>
>
I wasn't quite sure based on the wording of the OP, but if *this* is the
goal,
I was working on a similar problem the other day. I would not propose
the syntax *"x < y < z"* for obvious backwards-compatibility reasons, but
function objects like *std::less* can be modified for it since they don't
currently have a definition supporting variadic arguments.
struct logical_transitive_f {
template<class Pred, class X, class Y>
constexpr decltype(auto) operator() (Pred&& p, X&& x, Y&& y) const {
return p(x, y);
}
template<class Pred, class X, class Y, class...Z,
class = enable_if_t<(sizeof...(Z) > 0)>>
constexpr decltype(auto) operator() (Pred&& p, X&& x, Y&& y, Z&&...z)
const {
return p(x, y) ? (*this)(p, y, z...) : false;
}
} logical_transitive{};
auto less = [](auto...x) { return logical_transitive(std::less<>{}, x...);
};
auto equal_to = [](auto...x) { return logical_transitive(std::equal_to<>{},
x...); };
// etc...
This is a simplified, less generic version of what's in my library [1].
I removed the perfect forwarding for readability, and the generic version
also supports expressions like *"x op y || y op z" *(which isn't technically
a transitive relation, but maybe "logical_transitive" is a misnomer).
Admittedly, the syntax, *"std::less<>{}(x,y,z)"* has room for improvement,
but even though *"x < y < z"* would be ideal in the future, and likely wrong
in code today, it still has valid uses. For example,
*"x < y < pred(z)"* implies *"(x < y) < pred(z)"* implies *"pred(z) && !(x
< y)**"*.
(Assuming right-to-left evaluation. Otherwise, just make *pred(z)* first.)
[1]:
https://github.com/splinterofchaos/fu/blob/c2cb61b97d60e9eff67c8d83638d2387f7cf5df5/include/fu/logic/logic.h#L36-L54
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_394_1580990468.1425408075086
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br>On Tuesday, March 3, 2015 at 9:17:44 AM UTC-5, Yuriy S=
mirnov wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">=
If I understand you correctly, you want to use expressions like this?<div><=
br><div><div style=3D"border:1px solid rgb(187,187,187);word-wrap:break-wor=
d;background-color:rgb(250,250,250)"><code><div><span style=3D"color:#008">=
if</span><span style=3D"color:#660">(</span><span style=3D"color:#000">x1 <=
/span><span style=3D"color:#660">></span><span style=3D"color:#000"> x2 =
</span><span style=3D"color:#660">></span><span style=3D"color:#000"> x3=
</span><span style=3D"color:#660">></span><span style=3D"color:#000"> x=
4</span><span style=3D"color:#660">)</span><span style=3D"color:#000"> </sp=
an><span style=3D"color:#660">{}</span><span style=3D"color:#000"> </span><=
span style=3D"color:#800">// if(x1>x2 && x2>x3 && x3&=
gt;x4) {}</span></div></code></div><span style=3D"font-family:monospace;col=
or:rgb(136,0,0);background-color:rgb(250,250,250)"><div><span style=3D"font=
-family:monospace;color:rgb(136,0,0);background-color:rgb(250,250,250)"><br=
></span></div></span></div></div></div></blockquote><div><br></div><div>I w=
asn't quite sure based on the wording of the OP, but if <i>this</i> is=
the goal,</div><div>I was working on a similar problem the other day. I wo=
uld not propose</div><div>the syntax <i>"x < y < z"</i> for obvi=
ous backwards-compatibility reasons, but</div><div>function objects like <i=
>std::less</i> can be modified for it since they don't</div><div>curre=
ntly have a definition supporting variadic arguments.</div><div><br></div><=
div><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187=
); word-wrap: break-word; background-color: rgb(250, 250, 250);"><code clas=
s=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;=
" class=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> logical_transitive_f </span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"><br> </span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">template</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify"><</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-=
prettify">Pred</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">class</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> X</span><span styl=
e=3D"color: #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">class</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> Y</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">></span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br> </span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">constexpr</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify=
">decltype</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">auto</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">operator</span><span style=3D"col=
or: #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: #606;" class=3D"style=
d-by-prettify">Pred</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&&</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> p</span><span 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">&&</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> x</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> Y</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">&&</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> y</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">const</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br> &nbs=
p; </span><span style=3D"color: #008;" class=3D"styled-by-prettify">return<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> p</span><s=
pan 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">,</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> y</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"><br> </span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br><br> </span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">template</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify"><</span><span style=3D"color: #008;" class=3D"styled-by-prettify=
">class</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #606;" class=3D"styled-by-prettify">Pred</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: #008;" class=3D"styled-by-prettify">class</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> X</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">class</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> Y</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">class</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">...</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify">Z</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br> </span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">class</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> enable_if_t</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify"><(</span><span style=3D"color:=
#008;" class=3D"styled-by-prettify">sizeof</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">...(</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">Z</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
></span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #066;" class=3D"styled-by-prettify">0</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">)>></span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br> </span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">constexpr</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">decltype</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;"=
class=3D"styled-by-prettify">auto</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">operator</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">()</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span=
style=3D"color: #606;" class=3D"styled-by-prettify">Pred</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&&</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> p</span><span style=3D"colo=
r: #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">&&</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> x</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> Y</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&=
amp;&</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
y</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> Z</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&&...</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify">z</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">const</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: #000;" class=3D"styled-by-prettify=
"><br> </span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">return</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> p</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(<=
/span><font color=3D"#000000"><span style=3D"color: #000;" class=3D"styled-=
by-prettify">x</span></font><span style=3D"color: #660;" class=3D"styled-by=
-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> y</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">?</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">(*</span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">this</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">)(</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify">p</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> y</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> z</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;" c=
lass=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">false</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> logical_transitive</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">{};</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> less </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">=3D</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"sty=
led-by-prettify">auto</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">...</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">x</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</sp=
an><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: #0=
08;" class=3D"styled-by-prettify">return</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"> logical_transitive</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify">std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">less</span><span 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-prettif=
y">...);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> equal_to </span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color:=
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">[](</span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">auto</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">...</span><font color=3D"#000000"><span style=3D"color: #000=
;" class=3D"styled-by-prettify">x</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #008;" class=3D"styled-by-prettify">return</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> logical_transit=
ive</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">std</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify">equal_to</span><span style=3D"c=
olor: #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">...);</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: #000;" class=3D"styled-=
by-prettify"><br></span><span style=3D"color: #800;" class=3D"styled-by-pre=
ttify">// etc...</span></font></div></code></div><div><br></div></div><div>=
This is a simplified, less generic version of what's in my library [1].&nbs=
p;</div><div>I removed the perfect forwarding for readability, and the gene=
ric version</div><div>also supports expressions like <i>"x op y || y o=
p z" </i>(which isn't technically</div><div>a transitive relation, but mayb=
e "logical_transitive" is a misnomer).</div><div><br></div><div>Admittedly,=
the syntax, <i>"std::less<>{}(x,y,z)"</i> has room for improvem=
ent,</div><div>but even though <i>"x < y < z"</i> would be ideal=
in the future, and likely wrong</div><div>in code today, it still has vali=
d uses. For example,</div><div><i>"x < y < pred(z)"</i> implies =
<i>"(x < y) < pred(z)"</i> implies <i>"pred(z) && !=
(x < y)</i><i>"</i>.</div><div>(Assuming right-to-left evaluation. Other=
wise, just make <i>pred(z)</i> first.)</div><div><br></div><div>[1]:&n=
bsp;<a href=3D"https://github.com/splinterofchaos/fu/blob/c2cb61b97d60e9eff=
67c8d83638d2387f7cf5df5/include/fu/logic/logic.h#L36-L54">https://github.co=
m/splinterofchaos/fu/blob/c2cb61b97d60e9eff67c8d83638d2387f7cf5df5/include/=
fu/logic/logic.h#L36-L54</a><br></div></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_394_1580990468.1425408075086--
------=_Part_393_1178801549.1425408075086--
.
Author: Zhihao Yuan <zy@miator.net>
Date: Tue, 3 Mar 2015 14:27:38 -0500
Raw View
On Tue, Mar 3, 2015 at 1:41 PM, Scott Prager <splinterofchaos@gmail.com> wrote:
>
> Admittedly, the syntax, "std::less<>{}(x,y,z)" has room for improvement,
> but even though "x < y < z" would be ideal in the future, and likely wrong
> in code today, it still has valid uses. For example,
> "x < y < pred(z)" implies "(x < y) < pred(z)" implies "pred(z) && !(x < y)".
> (Assuming right-to-left evaluation. Otherwise, just make pred(z) first.)
How do I represent x < y <= z?
--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://bit.ly/blog4bsd
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Scott Prager <splinterofchaos@gmail.com>
Date: Tue, 3 Mar 2015 11:55:53 -0800 (PST)
Raw View
------=_Part_5355_728168779.1425412553671
Content-Type: multipart/alternative;
boundary="----=_Part_5356_1970848047.1425412553671"
------=_Part_5356_1970848047.1425412553671
Content-Type: text/plain; charset=UTF-8
On Tuesday, March 3, 2015 at 2:27:46 PM UTC-5, Zhihao Yuan wrote:
>
> On Tue, Mar 3, 2015 at 1:41 PM, Scott Prager <splinte...@gmail.com
> <javascript:>> wrote:
> >
> > Admittedly, the syntax, "std::less<>{}(x,y,z)" has room for improvement,
> > but even though "x < y < z" would be ideal in the future, and likely
> wrong
> > in code today, it still has valid uses. For example,
> > "x < y < pred(z)" implies "(x < y) < pred(z)" implies "pred(z) && !(x <
> y)".
> > (Assuming right-to-left evaluation. Otherwise, just make pred(z) first.)
>
> How do I represent x < y <= z?
>
less(x,y,z+1);
less(x,y) && equal_less(y,z);
// theoretically...
trans_apply(x, less, y, less_equal, z);
:-)
Obviously, it's not a perfect abstraction, especially if *z+1* isn't a valid
expression for the given type. I won't try to defend it, but I think it's
worth considering a comparable function as an alternative to a
breaking change.
>
>
> --
> Zhihao Yuan, ID lichray
> The best way to predict the future is to invent it.
> ___________________________________________________
> 4BSD -- http://bit.ly/blog4bsd
>
--
---
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
------=_Part_5356_1970848047.1425412553671
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Tuesday, March 3, 2015 at 2:27:46 PM UTC-5, Zhi=
hao Yuan wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On Tue, Mar 3, =
2015 at 1:41 PM, Scott Prager <<a href=3D"javascript:" target=3D"_blank"=
gdf-obfuscated-mailto=3D"EYillQj66M0J" rel=3D"nofollow" onmousedown=3D"thi=
s.href=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:';r=
eturn true;">splinte...@gmail.com</a>> wrote:
<br>>
<br>> Admittedly, the syntax, "std::less<>{}(x,y,z)" has room for =
improvement,
<br>> but even though "x < y < z" would be ideal in the future, an=
d likely wrong
<br>> in code today, it still has valid uses. For example,
<br>> "x < y < pred(z)" implies "(x < y) < pred(z)" implies =
"pred(z) && !(x < y)".
<br>> (Assuming right-to-left evaluation. Otherwise, just make pred(z) f=
irst.)
<br>
<br>How do I represent x < y <=3D z?
<br></blockquote><div><br></div><div class=3D"prettyprint" style=3D"border:=
1px solid rgb(187, 187, 187); word-wrap: break-word; background-color: rgb=
(250, 250, 250);"><code class=3D"prettyprint"><div class=3D"subprettyprint"=
><span style=3D"color: #000;" class=3D"styled-by-prettify">less</span><span=
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">,</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">y</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify">z</span><span style=3D"color: #660;" class=3D"styled-by-prettify">+=
</span><span style=3D"color: #066;" class=3D"styled-by-prettify">1</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br>less</span><span 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">,</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify">y</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">&&a=
mp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> equal_=
less</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify">y</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify">z</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br><br></span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">// theoretically...</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br>trans_apply</span><span 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">,</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> less</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> y<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> less_equal</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> z</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">);</span></div></code></div><div>:-)=
</div><div><i><br></i></div><div>Obviously, it's not a perfect abstraction,=
especially if <i>z+1</i> isn't a valid</div><div>expression for the g=
iven type. I won't try to defend it, but I think it's</div><div>worth consi=
dering a comparable function as an alternative to a </div><div>breakin=
g change.</div><div> </div><blockquote class=3D"gmail_quote" style=3D"=
margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;=
">
<br>
<br>--=20
<br>Zhihao Yuan, ID lichray
<br>The best way to predict the future is to invent it.
<br>______________________________<wbr>_____________________
<br>4BSD -- <a href=3D"http://bit.ly/blog4bsd" target=3D"_blank" rel=3D"nof=
ollow" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F=
%2Fbit.ly%2Fblog4bsd\46sa\75D\46sntz\0751\46usg\75AFQjCNENWZA3DF1H_gEgIkwnC=
r7FAkiCyQ';return true;" onclick=3D"this.href=3D'http://www.google.com/url?=
q\75http%3A%2F%2Fbit.ly%2Fblog4bsd\46sa\75D\46sntz\0751\46usg\75AFQjCNENWZA=
3DF1H_gEgIkwnCr7FAkiCyQ';return true;">http://bit.ly/blog4bsd</a>
<br></blockquote></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_5356_1970848047.1425412553671--
------=_Part_5355_728168779.1425412553671--
.
Author: =?UTF-8?Q?R=C3=B3bert_D=C3=A1vid?= <lrdxgm@gmail.com>
Date: Tue, 3 Mar 2015 17:31:06 -0800 (PST)
Raw View
------=_Part_5332_344269735.1425432666543
Content-Type: multipart/alternative;
boundary="----=_Part_5333_820491127.1425432666543"
------=_Part_5333_820491127.1425432666543
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
How would you like
if( chained_eval ->* x < y <=3D z ) { ... }
?
operator ->* is the highest-precedence binary operator, and binds=20
left-to-right, so whatever you put it after ->* will work as intended=20
without parenthesis..
http://goo.gl/8JsJvU
(obviously it needs overloads for all operators, I just added < and <=3D)
But to be honest, any solution should not be in the standard: it arguably=
=20
does not add *that* much, but the code is *really* not trivial; you won't=
=20
figure it out what is it doing just by looking at the code and "applying"=
=20
English (I e.g. had no idea how to name "foo"), unlike e.g. for_each or=20
chrono::high_resolution_clock::now(). The demand is also low, as the usual=
=20
other language also does not have such feature. Put it in a library like=20
Boost (go ahead, use my code :) ) for those who want to use it.
Regards,
Robert
2015. m=C3=A1rcius 3., kedd 20:55:53 UTC+1 id=C5=91pontban Scott Prager a k=
=C3=B6vetkez=C5=91t=20
=C3=ADrta:
>
>
>
> On Tuesday, March 3, 2015 at 2:27:46 PM UTC-5, Zhihao Yuan wrote:
>>
>> On Tue, Mar 3, 2015 at 1:41 PM, Scott Prager <splinte...@gmail.com>=20
>> wrote:=20
>> >=20
>> > Admittedly, the syntax, "std::less<>{}(x,y,z)" has room for=20
>> improvement,=20
>> > but even though "x < y < z" would be ideal in the future, and likely=
=20
>> wrong=20
>> > in code today, it still has valid uses. For example,=20
>> > "x < y < pred(z)" implies "(x < y) < pred(z)" implies "pred(z) && !(x =
<=20
>> y)".=20
>> > (Assuming right-to-left evaluation. Otherwise, just make pred(z)=20
>> first.)=20
>>
>> How do I represent x < y <=3D z?=20
>>
>
> less(x,y,z+1);
> less(x,y) && equal_less(y,z);
>
> // theoretically...
> trans_apply(x, less, y, less_equal, z);
> :-)
>
> Obviously, it's not a perfect abstraction, especially if *z+1* isn't a=20
> valid
> expression for the given type. I won't try to defend it, but I think it's
> worth considering a comparable function as an alternative to a=20
> breaking change.
> =20
>
>>
>>
>> --=20
>> Zhihao Yuan, ID lichray=20
>> The best way to predict the future is to invent it.=20
>> ___________________________________________________=20
>> 4BSD -- http://bit.ly/blog4bsd=20
>>
>
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_5333_820491127.1425432666543
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">How would you like<br><div class=3D"prettyprint" style=3D"=
background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); bor=
der-style: solid; border-width: 1px; word-wrap: break-word;"><code class=3D=
"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">if</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> chained_eval </span><span 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-prettif=
y"><</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> y =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify"><=3D</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> z </span><sp=
an 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: #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-pretti=
fy">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
/span></div></code></div>?<br><br>operator ->* is the highest-precedence=
binary operator, and binds left-to-right, so whatever you put it after -&g=
t;* will work as intended without parenthesis..<br><br><a href=3D"http://go=
o.gl/8JsJvU">http://goo.gl/8JsJvU</a><br>(obviously it needs overloads for =
all operators, I just added < and <=3D)<br><br>But to be honest, any =
solution should not be in the standard: it arguably does not add <i>that</i=
> much, but the code is <i>really</i> not trivial; you won't figure it out =
what is it doing just by looking at the code and "applying" English (I e.g.=
had no idea how to name "foo"), unlike e.g. for_each or chrono::high_resol=
ution_clock::now(). The demand is also low, as the usual other language als=
o does not have such feature. Put it in a library like Boost (go ahead, use=
my code :) ) for those who want to use it.<br><br>Regards,<br>Robert<br><b=
r><br>2015. m=C3=A1rcius 3., kedd 20:55:53 UTC+1 id=C5=91pontban Scott Prag=
er a k=C3=B6vetkez=C5=91t =C3=ADrta:<blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div dir=3D"ltr"><br><br>On Tuesday, March 3, 2015 at 2:27:46 PM UTC-=
5, Zhihao Yuan wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;ma=
rgin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, Mar 3,=
2015 at 1:41 PM, Scott Prager <<a rel=3D"nofollow">splinte...@gmail.com=
</a>> wrote:
<br>>
<br>> Admittedly, the syntax, "std::less<>{}(x,y,z)" has room for =
improvement,
<br>> but even though "x < y < z" would be ideal in the future, an=
d likely wrong
<br>> in code today, it still has valid uses. For example,
<br>> "x < y < pred(z)" implies "(x < y) < pred(z)" implies =
"pred(z) && !(x < y)".
<br>> (Assuming right-to-left evaluation. Otherwise, just make pred(z) f=
irst.)
<br>
<br>How do I represent x < y <=3D z?
<br></blockquote><div><br></div><div style=3D"border:1px solid rgb(187,187,=
187);word-wrap:break-word;background-color:rgb(250,250,250)"><code><div><sp=
an style=3D"color:#000">less</span><span style=3D"color:#660">(</span><span=
style=3D"color:#000">x</span><span style=3D"color:#660">,</span><span styl=
e=3D"color:#000">y</span><span style=3D"color:#660">,</span><span style=3D"=
color:#000">z</span><span style=3D"color:#660">+</span><span style=3D"color=
:#066">1</span><span style=3D"color:#660">);</span><span style=3D"color:#00=
0"><br>less</span><span style=3D"color:#660">(</span><span style=3D"color:#=
000">x</span><span style=3D"color:#660">,</span><span style=3D"color:#000">=
y</span><span style=3D"color:#660">)</span><span style=3D"color:#000"> </sp=
an><span style=3D"color:#660">&&</span><span style=3D"color:#000"> =
equal_less</span><span style=3D"color:#660">(</span><span style=3D"color:#0=
00">y</span><span style=3D"color:#660">,</span><span style=3D"color:#000">z=
</span><span style=3D"color:#660">);</span><span style=3D"color:#000"><br><=
br></span><span style=3D"color:#800">// theoretically...</span><span style=
=3D"color:#000"><br>trans_apply</span><span style=3D"color:#660">(</span><s=
pan style=3D"color:#000">x</span><span style=3D"color:#660">,</span><span s=
tyle=3D"color:#000"> less</span><span style=3D"color:#660">,</span><span st=
yle=3D"color:#000"> y</span><span style=3D"color:#660">,</span><span style=
=3D"color:#000"> less_equal</span><span style=3D"color:#660">,</span><span =
style=3D"color:#000"> z</span><span style=3D"color:#660">);</span></div></c=
ode></div><div>:-)</div><div><i><br></i></div><div>Obviously, it's not a pe=
rfect abstraction, especially if <i>z+1</i> isn't a valid</div><div>ex=
pression for the given type. I won't try to defend it, but I think it's</di=
v><div>worth considering a comparable function as an alternative to a =
</div><div>breaking change.</div><div> </div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;pad=
ding-left:1ex">
<br>
<br>--=20
<br>Zhihao Yuan, ID lichray
<br>The best way to predict the future is to invent it.
<br>______________________________<wbr>_____________________
<br>4BSD -- <a href=3D"http://bit.ly/blog4bsd" rel=3D"nofollow" target=3D"_=
blank" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F=
%2Fbit.ly%2Fblog4bsd\46sa\75D\46sntz\0751\46usg\75AFQjCNENWZA3DF1H_gEgIkwnC=
r7FAkiCyQ';return true;" onclick=3D"this.href=3D'http://www.google.com/url?=
q\75http%3A%2F%2Fbit.ly%2Fblog4bsd\46sa\75D\46sntz\0751\46usg\75AFQjCNENWZA=
3DF1H_gEgIkwnCr7FAkiCyQ';return true;">http://bit.ly/blog4bsd</a>
<br></blockquote></div></blockquote><mytubeelement data=3D"{"bundle&qu=
ot;:{"label_delimitor":":","percentage":"=
;%","smart_buffer":"Smart Buffer","start_play=
ing_when_buffered":"Start playing when buffered","sound=
":"Sound","desktop_notification":"Desktop Not=
ification","continuation_on_next_line":"-","l=
oop":"Loop","only_notify":"Only Notify",=
"estimated_time":"Estimated Time","global_preferen=
ces":"Global Preferences","no_notification_supported_on=
_your_browser":"No notification style supported on your browser v=
ersion","video_buffered":"Video Buffered","bu=
ffered":"Buffered","hyphen":"-","bu=
ffered_message":"The video has been buffered as requested and is =
ready to play.","not_supported":"Not Supported",&q=
uot;on":"On","off":"Off","click_to_=
enable_for_this_site":"Click to enable for this site","=
desktop_notification_denied":"You have denied permission for desk=
top notification for this site","notification_status_delimitor&qu=
ot;:";","error":"Error","adblock_interfe=
rance_message":"Adblock (or similar extension) is known to interf=
ere with SmartVideo. Please add this url to adblock whitelist.","=
calculating":"Calculating","waiting":"Waiting=
","will_start_buffering_when_initialized":"Will start b=
uffering when initialized","will_start_playing_when_initialized&q=
uot;:"Will start playing when initialized","completed":=
"Completed","buffering_stalled":"Buffering is stal=
led. Will stop.","stopped":"Stopped","hr"=
;:"Hr","min":"Min","sec":"Sec&=
quot;,"any_moment":"Any Moment","popup_donate_to&q=
uot;:"Donate to","extension_id":null},"prefs"=
:{"desktopNotification":true,"soundNotification":false,=
"logLevel":0,"enable":true,"loop":false,"=
;hidePopup":false,"autoPlay":false,"autoBuffer":tr=
ue,"autoPlayOnBuffer":true,"autoPlayOnBufferPercentage"=
:42,"autoPlayOnSmartBuffer":true,"quality":"hd1080=
","fshd":true,"onlyNotification":false,"enabl=
eFullScreen":true,"saveBandwidth":true,"hideAnnotations=
":true,"turnOffPagedBuffering":true}}" event=3D"preferencesU=
pdated" id=3D"myTubeRelayElementToPage"></mytubeelement><mytubeelement data=
=3D"{"loadBundle":true}" event=3D"relayPrefs" id=3D"myTubeRelayEl=
ementToTab"></mytubeelement></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_5333_820491127.1425432666543--
------=_Part_5332_344269735.1425432666543--
.
Author: Edward Catmur <ed@catmur.co.uk>
Date: Wed, 4 Mar 2015 04:03:13 -0800 (PST)
Raw View
------=_Part_6135_1899353347.1425470593551
Content-Type: multipart/alternative;
boundary="----=_Part_6136_87290374.1425470593551"
------=_Part_6136_87290374.1425470593551
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wednesday, 4 March 2015 01:31:06 UTC, R=C3=B3bert D=C3=A1vid wrote:
>
> But to be honest, any solution should not be in the standard: it arguably=
=20
> does not add *that* much, but the code is *really* not trivial; you won't=
=20
> figure it out what is it doing just by looking at the code and "applying"=
=20
> English (I e.g. had no idea how to name "foo"), unlike e.g. for_each or=
=20
> chrono::high_resolution_clock::now(). The demand is also low, as the usua=
l=20
> other language also does not have such feature.
>
=20
Chained operators seem popular enough in Python, though they can lead to=20
their own gotchas (5 in [5] is True).
--=20
---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.
------=_Part_6136_87290374.1425470593551
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Wednesday, 4 March 2015 01:31:06 UTC, R=C3=B3bert D=C3=
=A1vid wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
>But to be honest, any solution should not be in the standard: it arguably =
does not add <i>that</i> much, but the code is <i>really</i> not trivial; y=
ou won't figure it out what is it doing just by looking at the code and "ap=
plying" English (I e.g. had no idea how to name "foo"), unlike e.g. for_eac=
h or chrono::high_resolution_clock:<wbr>:now(). The demand is also low, as =
the usual other language also does not have such feature.</div></blockquote=
><div> </div><div>Chained operators seem popular enough in Python, tho=
ugh they can lead to their own gotchas (<font face=3D"courier new, monospac=
e">5 in [5] is True</font>).</div></div>
<p></p>
-- <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+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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_6136_87290374.1425470593551--
------=_Part_6135_1899353347.1425470593551--
.