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">&nbsp;</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=
">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </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">&nbsp;</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> &lt; <I style=3D"mso-bidi-font-style: normal">n</I>) are relationa=
l operators, namely one of =E2=80=98&lt;=E2=80=99, =E2=80=98&lt;=3D=E2=80=
=99, =E2=80=98&gt;=E2=80=99, =E2=80=98&gt;=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">&nbsp;</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">&nbsp;</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; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &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> &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<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> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<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> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<BR></SPAN><SPAN style=3D"COLO=
R: #800" class=3Dstyled-by-prettify>// =E2=80=A6 &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </SPAN><SP=
AN style=3D"COLOR: #000" class=3Dstyled-by-prettify>&nbsp;<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> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<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> &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &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=
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp;<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> &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp;<BR>false_part</SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by=
-prettify>:</SPAN><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &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> &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<B=
R>over</SPAN><SPAN style=3D"COLOR: #660" class=3Dstyled-by-prettify>:</SPAN=
><SPAN style=3D"COLOR: #000" class=3Dstyled-by-prettify> &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nb=
sp;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp;<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<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 &lt; <I style=3D"mso-bidi-font-style: normal">i</I> &lt; <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">&nbsp;</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">&nbsp; </=
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&quot; 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">&gt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> x2 </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">&gt;</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">&gt;</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&gt;x2 &amp;&amp; x2&gt;x3 &amp;&a=
mp; x3&gt;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&quot; 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">&gt;</span><span style=3D"color:#000"> x2 =
</span><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"> x3=
 </span><span style=3D"color:#660">&gt;</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&gt;x2 &amp;&amp; x2&gt;x3 &amp;&amp; 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>&nbsp;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 &lt; y &lt; z"</i>&nbsp;for obvi=
ous backwards-compatibility reasons, but</div><div>function objects like <i=
>std::less</i>&nbsp;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>&nbsp; </span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">template</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&lt;</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">&gt;</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br>&nbsp; </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">&amp;&amp;</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">&amp;&amp;</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">&amp;&amp;</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>&nbsp; &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>&nbsp; </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>&nbsp; </span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">template</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">&lt;</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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</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">&lt;(</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">=
&gt;</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">)&gt;&gt;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; </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">&amp;&amp;</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">&amp;&amp;</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;&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">&amp;&amp;...</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>&nbsp; &nbsp; </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>=
&nbsp; </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">&lt;&gt;{},</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">&lt;&gt;{},</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&nbsp;<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&lt;&gt;{}(x,y,z)"</i>&nbsp;has room for improvem=
ent,</div><div>but even though <i>"x &lt; y &lt; z"</i>&nbsp;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 &lt; y &lt; pred(z)"</i>&nbsp;implies =
<i>"(x &lt; y) &lt; pred(z)"</i>&nbsp;implies&nbsp;<i>"pred(z) &amp;&amp; !=
(x &lt; y)</i><i>"</i>.</div><div>(Assuming right-to-left evaluation. Other=
wise, just make <i>pred(z)</i>&nbsp;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&quot; 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 &lt;<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>&gt; wrote:
<br>&gt;
<br>&gt; Admittedly, the syntax, "std::less&lt;&gt;{}(x,y,z)" has room for =
improvement,
<br>&gt; but even though "x &lt; y &lt; z" would be ideal in the future, an=
d likely wrong
<br>&gt; in code today, it still has valid uses. For example,
<br>&gt; "x &lt; y &lt; pred(z)" implies "(x &lt; y) &lt; pred(z)" implies =
"pred(z) &amp;&amp; !(x &lt; y)".
<br>&gt; (Assuming right-to-left evaluation. Otherwise, just make pred(z) f=
irst.)
<br>
<br>How do I represent x &lt; y &lt;=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">&amp;&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>&nbsp;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&nbsp;</div><div>breakin=
g change.</div><div>&nbsp;</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&quot; 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">-&gt;*</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> x </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> y =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;=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 -&gt;* 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 &lt; and &lt;=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 &lt;<a rel=3D"nofollow">splinte...@gmail.com=
</a>&gt; wrote:
<br>&gt;
<br>&gt; Admittedly, the syntax, "std::less&lt;&gt;{}(x,y,z)" has room for =
improvement,
<br>&gt; but even though "x &lt; y &lt; z" would be ideal in the future, an=
d likely wrong
<br>&gt; in code today, it still has valid uses. For example,
<br>&gt; "x &lt; y &lt; pred(z)" implies "(x &lt; y) &lt; pred(z)" implies =
"pred(z) &amp;&amp; !(x &lt; y)".
<br>&gt; (Assuming right-to-left evaluation. Otherwise, just make pred(z) f=
irst.)
<br>
<br>How do I represent x &lt; y &lt;=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">&amp;&amp;</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>&nbsp;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&nbsp;=
</div><div>breaking change.</div><div>&nbsp;</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"{&quot;bundle&qu=
ot;:{&quot;label_delimitor&quot;:&quot;:&quot;,&quot;percentage&quot;:&quot=
;%&quot;,&quot;smart_buffer&quot;:&quot;Smart Buffer&quot;,&quot;start_play=
ing_when_buffered&quot;:&quot;Start playing when buffered&quot;,&quot;sound=
&quot;:&quot;Sound&quot;,&quot;desktop_notification&quot;:&quot;Desktop Not=
ification&quot;,&quot;continuation_on_next_line&quot;:&quot;-&quot;,&quot;l=
oop&quot;:&quot;Loop&quot;,&quot;only_notify&quot;:&quot;Only Notify&quot;,=
&quot;estimated_time&quot;:&quot;Estimated Time&quot;,&quot;global_preferen=
ces&quot;:&quot;Global Preferences&quot;,&quot;no_notification_supported_on=
_your_browser&quot;:&quot;No notification style supported on your browser v=
ersion&quot;,&quot;video_buffered&quot;:&quot;Video Buffered&quot;,&quot;bu=
ffered&quot;:&quot;Buffered&quot;,&quot;hyphen&quot;:&quot;-&quot;,&quot;bu=
ffered_message&quot;:&quot;The video has been buffered as requested and is =
ready to play.&quot;,&quot;not_supported&quot;:&quot;Not Supported&quot;,&q=
uot;on&quot;:&quot;On&quot;,&quot;off&quot;:&quot;Off&quot;,&quot;click_to_=
enable_for_this_site&quot;:&quot;Click to enable for this site&quot;,&quot;=
desktop_notification_denied&quot;:&quot;You have denied permission for desk=
top notification for this site&quot;,&quot;notification_status_delimitor&qu=
ot;:&quot;;&quot;,&quot;error&quot;:&quot;Error&quot;,&quot;adblock_interfe=
rance_message&quot;:&quot;Adblock (or similar extension) is known to interf=
ere with SmartVideo. Please add this url to adblock whitelist.&quot;,&quot;=
calculating&quot;:&quot;Calculating&quot;,&quot;waiting&quot;:&quot;Waiting=
&quot;,&quot;will_start_buffering_when_initialized&quot;:&quot;Will start b=
uffering when initialized&quot;,&quot;will_start_playing_when_initialized&q=
uot;:&quot;Will start playing when initialized&quot;,&quot;completed&quot;:=
&quot;Completed&quot;,&quot;buffering_stalled&quot;:&quot;Buffering is stal=
led. Will stop.&quot;,&quot;stopped&quot;:&quot;Stopped&quot;,&quot;hr&quot=
;:&quot;Hr&quot;,&quot;min&quot;:&quot;Min&quot;,&quot;sec&quot;:&quot;Sec&=
quot;,&quot;any_moment&quot;:&quot;Any Moment&quot;,&quot;popup_donate_to&q=
uot;:&quot;Donate to&quot;,&quot;extension_id&quot;:null},&quot;prefs&quot;=
:{&quot;desktopNotification&quot;:true,&quot;soundNotification&quot;:false,=
&quot;logLevel&quot;:0,&quot;enable&quot;:true,&quot;loop&quot;:false,&quot=
;hidePopup&quot;:false,&quot;autoPlay&quot;:false,&quot;autoBuffer&quot;:tr=
ue,&quot;autoPlayOnBuffer&quot;:true,&quot;autoPlayOnBufferPercentage&quot;=
:42,&quot;autoPlayOnSmartBuffer&quot;:true,&quot;quality&quot;:&quot;hd1080=
&quot;,&quot;fshd&quot;:true,&quot;onlyNotification&quot;:false,&quot;enabl=
eFullScreen&quot;:true,&quot;saveBandwidth&quot;:true,&quot;hideAnnotations=
&quot;:true,&quot;turnOffPagedBuffering&quot;:true}}" event=3D"preferencesU=
pdated" id=3D"myTubeRelayElementToPage"></mytubeelement><mytubeelement data=
=3D"{&quot;loadBundle&quot;: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&quot; 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>&nbsp;</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&quot; 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--

.