Topic: New compound assignment operators.:)


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 27 Oct 2015 13:00:47 -0700 (PDT)
Raw View
------=_Part_6878_1892424164.1445976047275
Content-Type: multipart/alternative;
 boundary="----=_Part_6879_1297557495.1445976047275"

------=_Part_6879_1297557495.1445976047275
Content-Type: text/plain; charset=UTF-8

I have a funny idea.

Operators ++ and -- have a very useful peculirity that are convinient to
use for example in expressions like this

if ( ++x == y++ ) { /*...*/ }

Without this possibility you have to write something like

int tmp = y;
y += 1;
x += 1;

if ( x == tmp ) { /*...*/  }

So the idea is to introduce compound operators like :)

=+, =-,=*,  =/, =%

These operators would return rvalue.

Provided the existence of these operators you could write for example

if ( ( x += value ) == ( y =+ value ) ) { /*... */ }

without introducing a temporary variable.:)

These operators are suitable to write compact lambda expressions for
algorithms.:)

--

---
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_6879_1297557495.1445976047275
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I have a funny idea.</div><div><br></div><div>Operato=
rs ++ and -- have a very useful peculirity that are convinient to use for e=
xample in expressions like this</div><div><br></div><div>if ( ++x =3D=3D y+=
+ ) { /*...*/ }</div><div><br></div><div>Without this possibility you have =
to write something like</div><div><br></div><div>int tmp =3D y;</div><div>y=
 +=3D 1;</div><div>x +=3D 1;</div><div><br></div><div>if ( x =3D=3D tmp ) {=
 /*...*/=C2=A0 }</div><div><br></div><div>So the=C2=A0idea is to introduce =
compound operators like :)</div><div><br></div><div>=3D+, =3D-,=3D*, =C2=A0=
=3D/, =3D%=C2=A0</div><div><br></div><div>These operators would return rval=
ue.</div><div><br></div><div>Provided the existence of these operators you =
could write for example</div><div><br></div><div>if ( ( x +=3D value ) =3D=
=3D ( y =3D+ value ) ) { /*... */ }</div><div><br></div><div>without introd=
ucing a temporary variable.:)</div><div><br></div><div>These operators are =
suitable to write compact lambda expressions for algorithms.:)</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_6879_1297557495.1445976047275--
------=_Part_6878_1892424164.1445976047275--

.


Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Tue, 27 Oct 2015 16:12:57 -0400
Raw View
On 2015-10-27 16:00, Vlad from Moscow wrote:
> So the idea is to introduce compound operators like :)
>
> =+, =-,=*,  =/, =%

At least the first two can't happen:

  // Currently valid code
  x =+ 2;
  y =- 4;
  // x == 2, y == -4

Even adding ()'s won't help.

I'm not necessarily saying that the idea itself is bad, but the proposed
syntax is not feasible.

--
Matthew

--

---
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: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 27 Oct 2015 13:27:23 -0700 (PDT)
Raw View
------=_Part_6950_928031894.1445977643740
Content-Type: multipart/alternative;
 boundary="----=_Part_6951_1719810581.1445977643740"

------=_Part_6951_1719810581.1445977643740
Content-Type: text/plain; charset=UTF-8



On Tuesday, October 27, 2015 at 11:13:12 PM UTC+3, Matthew Woehlke wrote:
>
> On 2015-10-27 16:00, Vlad from Moscow wrote:
> > So the idea is to introduce compound operators like :)
> >
> > =+, =-,=*,  =/, =%
>
> At least the first two can't happen:
>
>   // Currently valid code
>   x =+ 2;
>   y =- 4;
>   // x == 2, y == -4
>
> Even adding ()'s won't help.
>
> I'm not necessarily saying that the idea itself is bad, but the proposed
> syntax is not feasible.
>
> --
> Matthew
>
>
It is enough often  when I am writing a predicate for an algorithm I need
to return the result of a comparison or other logical operator. But before
to return the result I need to do some action with one of arguments or a
captured cariable that takes part in the logical expression. So I have to
introduce a boolean variable that to keep the result then do the action and
only after that return the result.

The idea came to my head when I was answering the following question at SO
http://stackoverflow.com/questions/33375769/a-zero-indexed-array-given-an-equilibrium-index-of-this-array/33376721#33376721

Instead of writing three statements in the if statement

    for ( size_t i = 0; i < sizeof( a ) / sizeof( *a ); i++ )
    {
        right_sum -= a[i];
        if ( left_sum == right_sum ) std::cout << i << ' ';
        left_sum += a[i];
    }

I could write only one statement :)

    for ( size_t i = 0; i < sizeof( a ) / sizeof( *a ); i++ )
    {
        if ( ( left_sum =+ a[i] ) == ( right_sum -= a[i] ) ) std::cout << i
<< ' ';
    }

--

---
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_6951_1719810581.1445977643740
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Tuesday, October 27, 2015 at 11:13:12 PM UTC+3,=
 Matthew Woehlke wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204);=
 border-left-width: 1px; border-left-style: solid;">On 2015-10-27 16:00, Vl=
ad from Moscow wrote:
<br>&gt; So the idea is to introduce compound operators like :)
<br>&gt;=20
<br>&gt; =3D+, =3D-,=3D*, =C2=A0=3D/, =3D%=20
<br>
<br>At least the first two can&#39;t happen:
<br>
<br>=C2=A0 // Currently valid code
<br>=C2=A0 x =3D+ 2;
<br>=C2=A0 y =3D- 4;
<br>=C2=A0 // x =3D=3D 2, y =3D=3D -4
<br>
<br>Even adding ()&#39;s won&#39;t help.
<br>
<br>I&#39;m not necessarily saying that the idea itself is bad, but the pro=
posed
<br>syntax is not feasible.
<br>
<br>--=20
<br>Matthew
<br>
<br></blockquote><div><br></div><div>It is enough often=C2=A0=C2=A0when I a=
m writing a predicate for an algorithm I need to return the result of a com=
parison or other logical operator. But before to return the result I need t=
o do some action with one of arguments or a captured cariable that takes pa=
rt in the logical expression. So I have to introduce a boolean variable tha=
t to keep the result then do the action and only after that return the resu=
lt.</div><div><br></div><div>The idea came to my head when I was answering =
the following question at SO <a href=3D"http://stackoverflow.com/questions/=
33375769/a-zero-indexed-array-given-an-equilibrium-index-of-this-array/3337=
6721#33376721">http://stackoverflow.com/questions/33375769/a-zero-indexed-a=
rray-given-an-equilibrium-index-of-this-array/33376721#33376721</a></div><d=
iv><br></div><div>Instead of writing three statements in the if statement</=
div><div><br></div><div><span class=3D"kwd">=C2=A0=C2=A0=C2=A0 for ( size_t=
 i =3D 0; i &lt; sizeof( a ) / sizeof( *a ); i++ )<br>=C2=A0=C2=A0=C2=A0 {<=
br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 right_sum -=3D a[i];<br>=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( left_sum =3D=3D right_sum )=C2=
=A0std::cout &lt;&lt; i &lt;&lt; &#39; &#39;;<br>=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 left_sum +=3D a[i];<br>=C2=A0=C2=A0=C2=A0 }<br></span></=
div><div>=C2=A0</div><div>I could write only one statement :)</div><div><br=
></div><div>=C2=A0=C2=A0=C2=A0 for ( size_t i =3D 0; i &lt; sizeof( a ) / s=
izeof( *a ); i++ )<br>=C2=A0=C2=A0=C2=A0 {<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 if ( ( left_sum =3D+ a[i]=C2=A0)=C2=A0=3D=3D ( right_sum -=
=3D a[i] ) )=C2=A0std::cout &lt;&lt; i &lt;&lt; &#39; &#39;;<br>=C2=A0=C2=
=A0=C2=A0 }<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_6951_1719810581.1445977643740--
------=_Part_6950_928031894.1445977643740--

.


Author: Sam Kellett <samkellett@gmail.com>
Date: Tue, 27 Oct 2015 20:37:41 +0000
Raw View
--001a11402550a8b87c05231c0c02
Content-Type: text/plain; charset=UTF-8

On 27 October 2015 at 20:27, Vlad from Moscow <vlad.moscow@mail.ru> wrote:

> It is enough often  when I am writing a predicate for an algorithm I need
> to return the result of a comparison or other logical operator. But before
> to return the result I need to do some action with one of arguments or a
> captured cariable that takes part in the logical expression. So I have to
> introduce a boolean variable that to keep the result then do the action and
> only after that return the result.
>
> The idea came to my head when I was answering the following question at SO
> http://stackoverflow.com/questions/33375769/a-zero-indexed-array-given-an-equilibrium-index-of-this-array/33376721#33376721
>
> Instead of writing three statements in the if statement
>
>     for ( size_t i = 0; i < sizeof( a ) / sizeof( *a ); i++ )
>     {
>         right_sum -= a[i];
>         if ( left_sum == right_sum ) std::cout << i << ' ';
>         left_sum += a[i];
>     }
>
> I could write only one statement :)
>
>     for ( size_t i = 0; i < sizeof( a ) / sizeof( *a ); i++ )
>     {
>         if ( ( left_sum =+ a[i] ) == ( right_sum -= a[i] ) ) std::cout <<
> i << ' ';
>     }
>

what's wrong with writing three statements?

--

---
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/.

--001a11402550a8b87c05231c0c02
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 27 October 2015 at 20:27, Vlad from Moscow <span dir=3D=
"ltr">&lt;<a href=3D"mailto:vlad.moscow@mail.ru" target=3D"_blank">vlad.mos=
cow@mail.ru</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span clas=
s=3D""></span><div>It is enough often=C2=A0=C2=A0when I am writing a predic=
ate for an algorithm I need to return the result of a comparison or other l=
ogical operator. But before to return the result I need to do some action w=
ith one of arguments or a captured cariable that takes part in the logical =
expression. So I have to introduce a boolean variable that to keep the resu=
lt then do the action and only after that return the result.</div><div><br>=
</div><div>The idea came to my head when I was answering the following ques=
tion at SO <a href=3D"http://stackoverflow.com/questions/33375769/a-zero-in=
dexed-array-given-an-equilibrium-index-of-this-array/33376721#33376721" tar=
get=3D"_blank">http://stackoverflow.com/questions/33375769/a-zero-indexed-a=
rray-given-an-equilibrium-index-of-this-array/33376721#33376721</a></div><d=
iv><br></div><div>Instead of writing three statements in the if statement</=
div><div><br></div><div><span>=C2=A0=C2=A0=C2=A0 for ( size_t i =3D 0; i &l=
t; sizeof( a ) / sizeof( *a ); i++ )<br>=C2=A0=C2=A0=C2=A0 {<br>=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 right_sum -=3D a[i];<br>=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( left_sum =3D=3D right_sum )=C2=A0std::cout=
 &lt;&lt; i &lt;&lt; &#39; &#39;;<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 left_sum +=3D a[i];<br>=C2=A0=C2=A0=C2=A0 }<br></span></div><div>=C2=
=A0</div><div>I could write only one statement :)</div><div><br></div><div>=
=C2=A0=C2=A0=C2=A0 for ( size_t i =3D 0; i &lt; sizeof( a ) / sizeof( *a );=
 i++ )<br>=C2=A0=C2=A0=C2=A0 {<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 if ( ( left_sum =3D+ a[i]=C2=A0)=C2=A0=3D=3D ( right_sum -=3D a[i] ) )=
=C2=A0std::cout &lt;&lt; i &lt;&lt; &#39; &#39;;<br>=C2=A0=C2=A0=C2=A0 }</d=
iv></div><div class=3D"HOEnZb"><div></div></div></blockquote><div><br></div=
><div>what&#39;s wrong with writing three statements?<br></div></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 />

--001a11402550a8b87c05231c0c02--

.


Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Tue, 27 Oct 2015 16:41:59 -0400
Raw View
On 2015-10-27 16:27, Vlad from Moscow wrote:
> On Tuesday, October 27, 2015 at 11:13:12 PM UTC+3, Matthew Woehlke wrote:
>> On 2015-10-27 16:00, Vlad from Moscow wrote:
>>> So the idea is to introduce compound operators like :)
>>>
>>> =+, =-,=*,  =/, =%
>>
>> At least the first two can't happen:
>>
>>   // Currently valid code
>>   x =+ 2;
>>   y =- 4;
>>   // x == 2, y == -4
>>
>> Even adding ()'s won't help.
>>
>> I'm not necessarily saying that the idea itself is bad, but the proposed
>> syntax is not feasible.
>
> It is enough often  when [...]

You didn't read what I wrote. Note: "I'm not necessarily saying that the
idea itself is bad". But then you try to argue why the general idea is
good, while completely ignoring the real problem: "the proposed syntax
is not feasible".

The following code is PERFECTLY VALID C++98/C++11/C++14.

  x =+ 2;
  y =- 4;

(Demonstration: http://ideone.com/iVZU7G. I'll let you figure out the
effect of the above code; it's not hard.)

Come up with some other syntax.

--
Matthew

--

---
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: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 27 Oct 2015 13:45:48 -0700 (PDT)
Raw View
------=_Part_854_1665892934.1445978748567
Content-Type: multipart/alternative;
 boundary="----=_Part_855_1646856497.1445978748567"

------=_Part_855_1646856497.1445978748567
Content-Type: text/plain; charset=UTF-8



On Tuesday, October 27, 2015 at 11:37:43 PM UTC+3, Sam Kellett wrote:
>
> On 27 October 2015 at 20:27, Vlad from Moscow <vlad....@mail.ru
> <javascript:>> wrote:
>
>> It is enough often  when I am writing a predicate for an algorithm I need
>> to return the result of a comparison or other logical operator. But before
>> to return the result I need to do some action with one of arguments or a
>> captured cariable that takes part in the logical expression. So I have to
>> introduce a boolean variable that to keep the result then do the action and
>> only after that return the result.
>>
>> The idea came to my head when I was answering the following question at
>> SO
>> http://stackoverflow.com/questions/33375769/a-zero-indexed-array-given-an-equilibrium-index-of-this-array/33376721#33376721
>>
>> Instead of writing three statements in the if statement
>>
>>     for ( size_t i = 0; i < sizeof( a ) / sizeof( *a ); i++ )
>>     {
>>         right_sum -= a[i];
>>         if ( left_sum == right_sum ) std::cout << i << ' ';
>>         left_sum += a[i];
>>     }
>>
>> I could write only one statement :)
>>
>>     for ( size_t i = 0; i < sizeof( a ) / sizeof( *a ); i++ )
>>     {
>>         if ( ( left_sum =+ a[i] ) == ( right_sum -= a[i] ) ) std::cout <<
>> i << ' ';
>>     }
>>
>
> what's wrong with writing three statements?
>

The more statements the less readable a corresponding lambda expression/:)

--

---
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_855_1646856497.1445978748567
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>On Tuesday, October 27, 2015 at 11:37:43 PM UTC+3, Sam Kellett wrot=
e:<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; pad=
ding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1=
px; border-left-style: solid;"><div dir=3D"ltr">On 27 October 2015 at 20:27=
, Vlad from Moscow <span dir=3D"ltr">&lt;<a onmousedown=3D"this.href=3D&#39=
;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39=
;;return true;" href=3D"javascript:" target=3D"_blank" rel=3D"nofollow" gdf=
-obfuscated-mailto=3D"PDiz7maqEgAJ">vlad....@mail.ru</a>&gt;</span> wrote:<=
br><div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=
=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(20=
4, 204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=
=3D"ltr"><span></span><div>It is enough often=C2=A0=C2=A0when I am writing =
a predicate for an algorithm I need to return the result of a comparison or=
 other logical operator. But before to return the result I need to do some =
action with one of arguments or a captured cariable that takes part in the =
logical expression. So I have to introduce a boolean variable that to keep =
the result then do the action and only after that return the result.</div><=
div><br></div><div>The idea came to my head when I was answering the follow=
ing question at SO <a onmousedown=3D"this.href=3D&#39;http://www.google.com=
/url?q\75http%3A%2F%2Fstackoverflow.com%2Fquestions%2F33375769%2Fa-zero-ind=
exed-array-given-an-equilibrium-index-of-this-array%2F33376721%2333376721\4=
6sa\75D\46sntz\0751\46usg\75AFQjCNFyFXzZYplZBkA2nxULUS80MNKPAg&#39;;return =
true;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\75http%3A%2F=
%2Fstackoverflow.com%2Fquestions%2F33375769%2Fa-zero-indexed-array-given-an=
-equilibrium-index-of-this-array%2F33376721%2333376721\46sa\75D\46sntz\0751=
\46usg\75AFQjCNFyFXzZYplZBkA2nxULUS80MNKPAg&#39;;return true;" href=3D"http=
://stackoverflow.com/questions/33375769/a-zero-indexed-array-given-an-equil=
ibrium-index-of-this-array/33376721#33376721" target=3D"_blank" rel=3D"nofo=
llow">http://stackoverflow.com/<wbr>questions/33375769/a-zero-<wbr>indexed-=
array-given-an-<wbr>equilibrium-index-of-this-<wbr>array/33376721#33376721<=
/a></div><div><br></div><div>Instead of writing three statements in the if =
statement</div><div><br></div><div><span>=C2=A0=C2=A0=C2=A0 for ( size_t i =
=3D 0; i &lt; sizeof( a ) / sizeof( *a ); i++ )<br>=C2=A0=C2=A0=C2=A0 {<br>=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 right_sum -=3D a[i];<br>=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( left_sum =3D=3D right_sum )=C2=A0=
std::cout &lt;&lt; i &lt;&lt; &#39; &#39;;<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 left_sum +=3D a[i];<br>=C2=A0=C2=A0=C2=A0 }<br></span></div=
><div>=C2=A0</div><div>I could write only one statement :)</div><div><br></=
div><div>=C2=A0=C2=A0=C2=A0 for ( size_t i =3D 0; i &lt; sizeof( a ) / size=
of( *a ); i++ )<br>=C2=A0=C2=A0=C2=A0 {<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 if ( ( left_sum =3D+ a[i]=C2=A0)=C2=A0=3D=3D ( right_sum -=3D =
a[i] ) )=C2=A0std::cout &lt;&lt; i &lt;&lt; &#39; &#39;;<br>=C2=A0=C2=A0=C2=
=A0 }</div></div><div><div></div></div></blockquote><div><br></div><div>wha=
t&#39;s wrong with writing three statements?<br></div></div></div></div></b=
lockquote><div><br></div><div>The more=C2=A0statements the less readable a =
corresponding lambda expression/:)=C2=A0</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_855_1646856497.1445978748567--
------=_Part_854_1665892934.1445978748567--

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 27 Oct 2015 13:47:33 -0700 (PDT)
Raw View
------=_Part_1071_1410113704.1445978853929
Content-Type: multipart/alternative;
 boundary="----=_Part_1072_969856050.1445978853929"

------=_Part_1072_969856050.1445978853929
Content-Type: text/plain; charset=UTF-8



On Tuesday, October 27, 2015 at 11:42:16 PM UTC+3, Matthew Woehlke wrote:
>
> On 2015-10-27 16:27, Vlad from Moscow wrote:
> > On Tuesday, October 27, 2015 at 11:13:12 PM UTC+3, Matthew Woehlke
> wrote:
> >> On 2015-10-27 16:00, Vlad from Moscow wrote:
> >>> So the idea is to introduce compound operators like :)
> >>>
> >>> =+, =-,=*,  =/, =%
> >>
> >> At least the first two can't happen:
> >>
> >>   // Currently valid code
> >>   x =+ 2;
> >>   y =- 4;
> >>   // x == 2, y == -4
> >>
> >> Even adding ()'s won't help.
> >>
> >> I'm not necessarily saying that the idea itself is bad, but the
> proposed
> >> syntax is not feasible.
> >
> > It is enough often  when [...]
>
> You didn't read what I wrote. Note: "I'm not necessarily saying that the
> idea itself is bad". But then you try to argue why the general idea is
> good, while completely ignoring the real problem: "the proposed syntax
> is not feasible".
>
> The following code is PERFECTLY VALID C++98/C++11/C++14.
>
>   x =+ 2;
>   y =- 4;
>
> (Demonstration: http://ideone.com/iVZU7G. I'll let you figure out the
> effect of the above code; it's not hard.)
>
> Come up with some other syntax.
>
> --
> Matthew
>
>
I understand this. It is the reason I wrote that it is a funny idea.:)

--

---
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_1072_969856050.1445978853929
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>On Tuesday, October 27, 2015 at 11:42:16 PM UTC+3, Matthew Woehlke =
wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex;=
 padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-widt=
h: 1px; border-left-style: solid;">On 2015-10-27 16:27, Vlad from Moscow wr=
ote:
<br>&gt; On Tuesday, October 27, 2015 at 11:13:12 PM UTC+3, Matthew Woehlke=
 wrote:
<br>&gt;&gt; On 2015-10-27 16:00, Vlad from Moscow wrote:=20
<br>&gt;&gt;&gt; So the idea is to introduce compound operators like :)=20
<br>&gt;&gt;&gt;
<br>&gt;&gt;&gt; =3D+, =3D-,=3D*, =C2=A0=3D/, =3D%=20
<br>&gt;&gt;
<br>&gt;&gt; At least the first two can&#39;t happen:=20
<br>&gt;&gt;
<br>&gt;&gt; =C2=A0 // Currently valid code=20
<br>&gt;&gt; =C2=A0 x =3D+ 2;=20
<br>&gt;&gt; =C2=A0 y =3D- 4;=20
<br>&gt;&gt; =C2=A0 // x =3D=3D 2, y =3D=3D -4=20
<br>&gt;&gt;
<br>&gt;&gt; Even adding ()&#39;s won&#39;t help.=20
<br>&gt;&gt;
<br>&gt;&gt; I&#39;m not necessarily saying that the idea itself is bad, bu=
t the proposed=20
<br>&gt;&gt; syntax is not feasible.=20
<br>&gt;
<br>&gt; It is enough often =C2=A0when [...]
<br>
<br>You didn&#39;t read what I wrote. Note: &quot;I&#39;m not necessarily s=
aying that the
<br>idea itself is bad&quot;. But then you try to argue why the general ide=
a is
<br>good, while completely ignoring the real problem: &quot;the proposed sy=
ntax
<br>is not feasible&quot;.
<br>
<br>The following code is PERFECTLY VALID C++98/C++11/C++14.
<br>
<br>=C2=A0 x =3D+ 2;
<br>=C2=A0 y =3D- 4;
<br>
<br>(Demonstration: <a onmousedown=3D"this.href=3D&#39;http://www.google.co=
m/url?q\75http%3A%2F%2Fideone.com%2FiVZU7G\46sa\75D\46sntz\0751\46usg\75AFQ=
jCNG3VAduR6XWeF8PY1d7HhAQ-0ikiQ&#39;;return true;" onclick=3D"this.href=3D&=
#39;http://www.google.com/url?q\75http%3A%2F%2Fideone.com%2FiVZU7G\46sa\75D=
\46sntz\0751\46usg\75AFQjCNG3VAduR6XWeF8PY1d7HhAQ-0ikiQ&#39;;return true;" =
href=3D"http://ideone.com/iVZU7G" target=3D"_blank" rel=3D"nofollow">http:/=
/ideone.com/iVZU7G</a>. I&#39;ll let you figure out the
<br>effect of the above code; it&#39;s not hard.)
<br>
<br>Come up with some other syntax.
<br>
<br>--=20
<br>Matthew
<br>
<br></blockquote><div><br></div><div>I understand this. It is the reason I =
wrote that it is a funny idea.:)=C2=A0</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_1072_969856050.1445978853929--
------=_Part_1071_1410113704.1445978853929--

.


Author: Brent Friedman <fourthgeek@gmail.com>
Date: Tue, 27 Oct 2015 16:06:06 -0500
Raw View
--047d7b33d2de462a4c05231c7260
Content-Type: text/plain; charset=UTF-8

lol

On Tue, Oct 27, 2015 at 3:47 PM, Vlad from Moscow <vlad.moscow@mail.ru>
wrote:

>
>
> On Tuesday, October 27, 2015 at 11:42:16 PM UTC+3, Matthew Woehlke wrote:
>>
>> On 2015-10-27 16:27, Vlad from Moscow wrote:
>> > On Tuesday, October 27, 2015 at 11:13:12 PM UTC+3, Matthew Woehlke
>> wrote:
>> >> On 2015-10-27 16:00, Vlad from Moscow wrote:
>> >>> So the idea is to introduce compound operators like :)
>> >>>
>> >>> =+, =-,=*,  =/, =%
>> >>
>> >> At least the first two can't happen:
>> >>
>> >>   // Currently valid code
>> >>   x =+ 2;
>> >>   y =- 4;
>> >>   // x == 2, y == -4
>> >>
>> >> Even adding ()'s won't help.
>> >>
>> >> I'm not necessarily saying that the idea itself is bad, but the
>> proposed
>> >> syntax is not feasible.
>> >
>> > It is enough often  when [...]
>>
>> You didn't read what I wrote. Note: "I'm not necessarily saying that the
>> idea itself is bad". But then you try to argue why the general idea is
>> good, while completely ignoring the real problem: "the proposed syntax
>> is not feasible".
>>
>> The following code is PERFECTLY VALID C++98/C++11/C++14.
>>
>>   x =+ 2;
>>   y =- 4;
>>
>> (Demonstration: http://ideone.com/iVZU7G. I'll let you figure out the
>> effect of the above code; it's not hard.)
>>
>> Come up with some other syntax.
>>
>> --
>> Matthew
>>
>>
> I understand this. It is the reason I wrote that it is a funny idea.:)
>
> --
>
> ---
> 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/.
>

--

---
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/.

--047d7b33d2de462a4c05231c7260
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">lol</div><div class=3D"gmail_extra"><br><div class=3D"gmai=
l_quote">On Tue, Oct 27, 2015 at 3:47 PM, Vlad from Moscow <span dir=3D"ltr=
">&lt;<a href=3D"mailto:vlad.moscow@mail.ru" target=3D"_blank">vlad.moscow@=
mail.ru</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=
=3D"HOEnZb"><div class=3D"h5"><br><br>On Tuesday, October 27, 2015 at 11:42=
:16 PM UTC+3, Matthew Woehlke wrote:<blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204=
,204);border-left-width:1px;border-left-style:solid">On 2015-10-27 16:27, V=
lad from Moscow wrote:
<br>&gt; On Tuesday, October 27, 2015 at 11:13:12 PM UTC+3, Matthew Woehlke=
 wrote:
<br>&gt;&gt; On 2015-10-27 16:00, Vlad from Moscow wrote:=20
<br>&gt;&gt;&gt; So the idea is to introduce compound operators like :)=20
<br>&gt;&gt;&gt;
<br>&gt;&gt;&gt; =3D+, =3D-,=3D*, =C2=A0=3D/, =3D%=20
<br>&gt;&gt;
<br>&gt;&gt; At least the first two can&#39;t happen:=20
<br>&gt;&gt;
<br>&gt;&gt; =C2=A0 // Currently valid code=20
<br>&gt;&gt; =C2=A0 x =3D+ 2;=20
<br>&gt;&gt; =C2=A0 y =3D- 4;=20
<br>&gt;&gt; =C2=A0 // x =3D=3D 2, y =3D=3D -4=20
<br>&gt;&gt;
<br>&gt;&gt; Even adding ()&#39;s won&#39;t help.=20
<br>&gt;&gt;
<br>&gt;&gt; I&#39;m not necessarily saying that the idea itself is bad, bu=
t the proposed=20
<br>&gt;&gt; syntax is not feasible.=20
<br>&gt;
<br>&gt; It is enough often =C2=A0when [...]
<br>
<br>You didn&#39;t read what I wrote. Note: &quot;I&#39;m not necessarily s=
aying that the
<br>idea itself is bad&quot;. But then you try to argue why the general ide=
a is
<br>good, while completely ignoring the real problem: &quot;the proposed sy=
ntax
<br>is not feasible&quot;.
<br>
<br>The following code is PERFECTLY VALID C++98/C++11/C++14.
<br>
<br>=C2=A0 x =3D+ 2;
<br>=C2=A0 y =3D- 4;
<br>
<br>(Demonstration: <a href=3D"http://ideone.com/iVZU7G" rel=3D"nofollow" t=
arget=3D"_blank">http://ideone.com/iVZU7G</a>. I&#39;ll let you figure out =
the
<br>effect of the above code; it&#39;s not hard.)
<br>
<br>Come up with some other syntax.
<br>
<br>--=20
<br>Matthew
<br>
<br></blockquote><div><br></div></div></div><div>I understand this. It is t=
he reason I wrote that it is a funny idea.:)=C2=A0</div><div class=3D"HOEnZ=
b"><div class=3D"h5">

<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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></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 />

--047d7b33d2de462a4c05231c7260--

.


Author: Bo Persson <bop@gmb.dk>
Date: Wed, 28 Oct 2015 00:00:23 +0100
Raw View
On 2015-10-27 21:00, Vlad from Moscow wrote:
> I have a funny idea.
>
> Operators ++ and -- have a very useful peculirity that are convinient to
> use for example in expressions like this
>
> if ( ++x == y++ ) { /*...*/ }
>
> Without this possibility you have to write something like
>
> int tmp = y;
> y += 1;
> x += 1;
>
> if ( x == tmp ) { /*...*/  }
>
> So the idea is to introduce compound operators like :)
>
> =+, =-,=*,  =/, =%
>
> These operators would return rvalue.
>
> Provided the existence of these operators you could write for example
>
> if ( ( x += value ) == ( y =+ value ) ) { /*... */ }
>
> without introducing a temporary variable.:)
>
> These operators are suitable to write compact lambda expressions for
> algorithms.:)
>

Kind of funny, but I guess you might know that these operators WERE
present in primordial C, until Ken Thompson noticed that

x =- 1;
x=-1;
x = -1;

parsed differently. And then he invented the new syntax

x -= 1;



Bo Persson



--

---
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: =?UTF-8?Q?David_Rodr=C3=ADguez_Ibeas?= <dibeas@ieee.org>
Date: Tue, 27 Oct 2015 23:03:07 +0000
Raw View
--f46d0438900bb964e905231e1455
Content-Type: text/plain; charset=UTF-8

On Tue, Oct 27, 2015 at 8:45 PM, Vlad from Moscow <vlad.moscow@mail.ru>
wrote:

>
> The more statements the less readable a corresponding lambda expression/:)
>
> Personally I disagree. In the code example you presented, parsing the
contents of the 'if' and figuring out what it means requires much more
effort on my side than looking at the original code or:

int total = std::accumulate(std::begin(a), std::begin(a), 0);
int partial = 0;
for (int i = 0; i < N; ++i) {
   int current = a[i];
   if (total - current == 2*partial) {
        std::cout <<  i;
   }
   partial += current;
}

The language is already obscure enough to add more operator overloads.
Programming is about showing intent, and an 'if' that modifies two
different variables one before and the other after the comparison of the
values is not something simple to chew.

Just my 2c.

    David

--

---
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/.

--f46d0438900bb964e905231e1455
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tue, Oct 27, 2015 at 8:45 PM, Vlad from Moscow <span di=
r=3D"ltr">&lt;<a href=3D"mailto:vlad.moscow@mail.ru" target=3D"_blank">vlad=
..moscow@mail.ru</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div cl=
ass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div>The more=C2=A0s=
tatements the less readable a corresponding lambda expression/:)=C2=A0</div=
><div class=3D"HOEnZb"><div class=3D"h5">

<p></p></div></div></blockquote></div>Personally I disagree. In the code ex=
ample you presented, parsing the contents of the &#39;if&#39; and figuring =
out what it means requires much more effort on my side than looking at the =
original code or:</div><div class=3D"gmail_extra"><br></div><div class=3D"g=
mail_extra">int total =3D std::accumulate(std::begin(a), std::begin(a), 0);=
<br></div><div class=3D"gmail_extra">int partial =3D 0;</div><div class=3D"=
gmail_extra">for (int i =3D 0; i &lt; N; ++i) {</div><div class=3D"gmail_ex=
tra">=C2=A0 =C2=A0int current =3D a[i];</div><div class=3D"gmail_extra">=C2=
=A0 =C2=A0if (total - current =3D=3D 2*partial) {<br></div><div class=3D"gm=
ail_extra">=C2=A0 =C2=A0 =C2=A0 =C2=A0 std::cout &lt;&lt; =C2=A0i;<br></div=
><div class=3D"gmail_extra">=C2=A0 =C2=A0}</div><div class=3D"gmail_extra">=
=C2=A0 =C2=A0partial +=3D current;</div><div class=3D"gmail_extra">}</div><=
div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">The language=
 is already obscure enough to add more operator overloads. Programming is a=
bout showing intent, and an &#39;if&#39; that modifies two different variab=
les one before and the other after the comparison of the values is not some=
thing simple to chew.</div><div class=3D"gmail_extra"><br></div><div class=
=3D"gmail_extra">Just my 2c.</div><div class=3D"gmail_extra"><br></div><div=
 class=3D"gmail_extra">=C2=A0 =C2=A0 David</div><div class=3D"gmail_extra">=
<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 />

--f46d0438900bb964e905231e1455--

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Tue, 27 Oct 2015 17:08:57 -0700 (PDT)
Raw View
------=_Part_3572_1557661945.1445990937399
Content-Type: multipart/alternative;
 boundary="----=_Part_3573_690692120.1445990937399"

------=_Part_3573_690692120.1445990937399
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable



On Wednesday, October 28, 2015 at 2:03:08 AM UTC+3, David Rodr=C3=ADguez Ib=
eas=20
wrote:
>
> On Tue, Oct 27, 2015 at 8:45 PM, Vlad from Moscow <vlad....@mail.ru=20
> <javascript:>> wrote:
>
>>
>> The more statements the less readable a corresponding lambda=20
>> expression/:)=20
>>
>> Personally I disagree. In the code example you presented, parsing the=20
> contents of the 'if' and figuring out what it means requires much more=20
> effort on my side than looking at the original code or:
>
> int total =3D std::accumulate(std::begin(a), std::begin(a), 0);
> int partial =3D 0;
> for (int i =3D 0; i < N; ++i) {
>    int current =3D a[i];
>    if (total - current =3D=3D 2*partial) {
>         std::cout <<  i;
>    }
>    partial +=3D current;
> }
>
> The language is already obscure enough to add more operator overloads.=20
> Programming is about showing intent, and an 'if' that modifies two=20
> different variables one before and the other after the comparison of the=
=20
> values is not something simple to chew.
>
> Just my 2c.
>
>     David
>
>
But if you will try to write this as an "inline" lambda expression that=20
returns either true of false in some algorithm then you will see that=20
it does not look very well because the statemenet with the call of the=20
algorithm will be too compound.=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_3573_690692120.1445990937399
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<br><br>On Wednesday, October 28, 2015 at 2:03:08 AM UTC+3, David Rodr=C3=
=ADguez Ibeas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0px =
0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); bo=
rder-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr">On Tue, O=
ct 27, 2015 at 8:45 PM, Vlad from Moscow <span dir=3D"ltr">&lt;<a onmousedo=
wn=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=
=3D&#39;javascript:&#39;;return true;" href=3D"javascript:" target=3D"_blan=
k" rel=3D"nofollow" gdf-obfuscated-mailto=3D"xOwTaFayEgAJ">vlad....@mail.ru=
</a>&gt;</span> wrote:<br><div><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bor=
der-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-sty=
le: solid;"><br><div>The more=C2=A0statements the less readable a correspon=
ding lambda expression/:)=C2=A0</div><div><div>

<p></p></div></div></blockquote></div>Personally I disagree. In the code ex=
ample you presented, parsing the contents of the &#39;if&#39; and figuring =
out what it means requires much more effort on my side than looking at the =
original code or:</div><div><br></div><div>int total =3D std::accumulate(st=
d::begin(a), std::begin(a), 0);<br></div><div>int partial =3D 0;</div><div>=
for (int i =3D 0; i &lt; N; ++i) {</div><div>=C2=A0 =C2=A0int current =3D a=
[i];</div><div>=C2=A0 =C2=A0if (total - current =3D=3D 2*partial) {<br></di=
v><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 std::cout &lt;&lt; =C2=A0i;<br></div><di=
v>=C2=A0 =C2=A0}</div><div>=C2=A0 =C2=A0partial +=3D current;</div><div>}</=
div><div><br></div><div>The language is already obscure enough to add more =
operator overloads. Programming is about showing intent, and an &#39;if&#39=
; that modifies two different variables one before and the other after the =
comparison of the values is not something simple to chew.</div><div><br></d=
iv><div>Just my 2c.</div><div><br></div><div>=C2=A0 =C2=A0 David</div><div>=
<br></div></div></blockquote><div><br></div><div>But if you will try to wri=
te=C2=A0this as an &quot;inline&quot; lambda expression=C2=A0that returns e=
ither true of false in some algorithm then you will see that it=C2=A0does n=
ot look very well=C2=A0because the statemenet with the call of the algorith=
m will be too compound.=C2=A0</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_3573_690692120.1445990937399--
------=_Part_3572_1557661945.1445990937399--

.