220 32293 <9edfd06a-7421-4ce0-80fd-83c436ad7b20@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Controlled Argument Evaluation
Date: Wed, 3 May 2017 12:59:32 -0700 (PDT)
Lines: 135
Approved: news@gmane.org
Message-ID: <9edfd06a-7421-4ce0-80fd-83c436ad7b20@isocpp.org>
References: <CAF3xnJTfp7PXYNYj5k9V5yyyXgC+oZbTBizRkcQLvSr=h6aBEA@mail.gmail.com>
 <04e0ce66-76df-43e2-a10a-77b4db64ca25@isocpp.org> <CAHSYqdbKDY00qPr_xZ1n5+cnxQXv6RHrqDXh31m5kf6vNeoNyQ@mail.gmail.com>
 <362f82cb-2516-93a8-09bc-b0208c21e8aa@weka.io>
 <CAHSYqdbkooxCXhgSNF-ZcY26ObQsbawQzPUYXPRk2NA9eOqKOw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_100_88992680.1493841572198"
X-Trace: blaine.gmane.org 1493841580 15935 195.159.176.226 (3 May 2017 19:59:40 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 3 May 2017 19:59:40 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBJHNVDEAKGQEUKFSHII@isocpp.org Wed May 03 21:59:34 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBBJHNVDEAKGQEUKFSHII@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f198.google.com ([209.85.192.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBJHNVDEAKGQEUKFSHII@isocpp.org>)
	id 1d60Qq-0003rS-De
	for gclcip-std-proposals@m.gmane.org; Wed, 03 May 2017 21:59:28 +0200
Original-Received: by mail-pf0-f198.google.com with SMTP id j16sf54018pfk.4
        for <gclcip-std-proposals@m.gmane.org>; Wed, 03 May 2017 12:59:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=qHNMXI9rOOuzGDniultt6LUZv9bWEgSoVBSDS0lXroU=;
        b=alECxJAbj/DjvMgug3WawowiHVnQ0mu0xdbWgIs74w5RzX8ombN+/wyHA2ZJQowGa/
         NwmeUL+BVVbIhV4BMKcrOfhlawcwyiufete6Et9aq6MZsoIWQuFIDAe0r5Fkh5lAV+PE
         aZTIt/hjlsHMwMYoB6/jZ6ESpIYJzYILQvVozKDTvyYIisd6LVY+Urn8zU38mn4Yk0Oa
         5ypKjpXgQo6/uIlTLu+vRLwxadKnBvocUVLQ2oClwAOZhdc14YNo4/v/EiztoFSes4He
         XnIQVwo26kyVpqvH6TsGYICJBOhQoJdGb0+DlYeEDzkim10vjaG2jHTe4SyBIehW0tUf
         UbZw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=qHNMXI9rOOuzGDniultt6LUZv9bWEgSoVBSDS0lXroU=;
        b=WZG76Wb9tzgSIkN5eJr7mUdxvU+0Nh1q7gP7hYr9ZQrzcbY5qxdFRFy3rftRpkqkBI
         25m6BrZ19MCX6r7lH46mAX+u/Q77QWYVYn29B/nt9cIAGhk7uW3E1kuLsTis65l0LZ4m
         ZS/oPAS9SYeX5HyriLQIyofWhX3txtEUQggwJpi752+UmM/crGnl+tLhZOhWXJc7YSpO
         Nf++di7xbA2saK8HgXnqWpxtbglJIL2wJJLzRUdZs7iZ95cCRNAXoDkx50eliNbQdbeS
         TBLkPbsUlfepVq6WBZONkbDnHtbHqZBUeEp6oCykYE/sT40TAzzsNcMaqCZM46UfYVzZ
         M9yw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=qHNMXI9rOOuzGDniultt6LUZv9bWEgSoVBSDS0lXroU=;
        b=TjZ3racouFSd+3pCaVoTg9tEukKq9frJKkwS8SNcRSP+CAxxMwii7/IlrW2JJ3uNBs
         brQJbFsaPCcbiyabTRfxO7TLZbr/KuZKcXmTKVUTaRcli2jHi3wvFE3Of6zeTOlMiMus
         17U/LwQmNcNgiJNQpDSAbQSvR/p3Z+6BQ+dSMCMxgQIEPK0dW5Kgv0DP/lr9vmsZrLWo
         Tny33gj+UucP1h4CNJOKg+9KalwX+r5K7daIdE8W2Ec7z2jX9eU+xdwQfvUp7MW2suwL
         CdopwVlQiuV8QN+cfM3EhdSeMo6LNZASrIjGPZ6eAhtSLEhQiLYEYNM+EAffYA3pyaYW
         WISg==
X-Gm-Message-State: AN3rC/7XpKRR4M0kh5hgXoLlP77qdhSPjyqJ7/xKoIZXlS6/Ym5f24bJ
	gjawIrVgKalc+Q==
X-Received: by 10.99.135.198 with SMTP id i189mr7863893pge.83.1493841573591;
        Wed, 03 May 2017 12:59:33 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.6.201 with SMTP id 67ls4797473otx.29.gmail; Wed, 03 May
 2017 12:59:32 -0700 (PDT)
X-Received: by 10.157.55.133 with SMTP id x5mr320579otb.10.1493841572654;
        Wed, 03 May 2017 12:59:32 -0700 (PDT)
In-Reply-To: <CAHSYqdbkooxCXhgSNF-ZcY26ObQsbawQzPUYXPRk2NA9eOqKOw@mail.gmail.com>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:32293
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32293>

------=_Part_100_88992680.1493841572198
Content-Type: multipart/alternative; 
	boundary="----=_Part_101_498146799.1493841572199"

------=_Part_101_498146799.1493841572199
Content-Type: text/plain; charset=UTF-8



On Wednesday, May 3, 2017 at 3:05:32 PM UTC-4, Hyman Rosen wrote:
>
> On Wed, May 3, 2017 at 2:34 PM, Shachar Shemesh <sha...@weka.io 
> <javascript:>> wrote:
>
>> On 27/04/17 22:29, Hyman Rosen wrote:
>>
>> On Thu, Apr 27, 2017 at 3:26 PM, Dan Raviv <dan....@gmail.com 
>> <javascript:>> wrote:
>>
>>> Why not just use some sort of lazy evaluation class and wrap the 
>>> parameters you pass in with it?
>>>
>>
>> Because a proposal like this should make it possible for user-written 
>> *operator&&*, *operator||*, and *operator,* to behave like their 
>> built-in counterparts.
>>
>> Can someone please explain to me why that is desirable? Preferrably with 
>> an example.
>>
>
> The C++ language allows user-defined *operator&&*, *operator||*, and 
> *operator,* for classes.  The built-in language versions are 
> short-circuiting for && and || and guarantee left-to-right evaluation for 
> comma.
>

The latter part of that is no longer true in C++17. The order of evaluation 
for comma is guaranteed regardless of whether it's calling `operator,` or 
using the built-in one:

> Overloaded operators obey the rules for syntax and evaluation order 
specified in Clause 8, but the requirements of operand type and value 
category are replaced by the rules for function call.

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/9edfd06a-7421-4ce0-80fd-83c436ad7b20%40isocpp.org.

------=_Part_101_498146799.1493841572199
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, May 3, 2017 at 3:05:32 PM UTC-4, Hym=
an Rosen wrote:<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=
"><div><div class=3D"gmail_quote">On Wed, May 3, 2017 at 2:34 PM, Shachar S=
hemesh <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-=
obfuscated-mailto=3D"OOTTgRZABAAJ" rel=3D"nofollow" onmousedown=3D"this.hre=
f=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascr=
ipt:&#39;;return true;">sha...@weka.io</a>&gt;</span> wrote:<br><blockquote=
 class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex">
 =20
   =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF"><div><div>
    <div>On 27/04/17 22:29, Hyman Rosen wrote:<br>
    </div>
    <blockquote type=3D"cite">
      <div dir=3D"ltr">
        <div>
          <div class=3D"gmail_quote">On Thu, Apr 27, 2017 at 3:26 PM, Dan
            Raviv <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_=
blank" gdf-obfuscated-mailto=3D"OOTTgRZABAAJ" rel=3D"nofollow" onmousedown=
=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D=
&#39;javascript:&#39;;return true;">dan....@gmail.com</a>&gt;</span>
            wrote:<br>
            <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
..8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div dir=3D"ltr">Why not just use some sort of lazy
                evaluation class and wrap the parameters you pass in
                with it?</div>
            </blockquote>
            <div><br>
            </div>
            <div>Because a proposal like this should make it possible
              for user-written <font face=3D"monospace, monospace"><b>opera=
tor&amp;&amp;</b></font>,
              <font face=3D"monospace, monospace"><b>operator||</b></font>,
              and <font face=3D"monospace, monospace"><b>operator,</b></fon=
t>
              to behave like their built-in counterparts.</div>
          </div>
        </div>
      </div>
    </blockquote></div></div>
    Can someone please explain to me why that is desirable? Preferrably
    with an example.</div></blockquote><div><br>The C++ language allows use=
r-defined <font face=3D"monospace, monospace"><b>operator&amp;&amp;</b></fo=
nt>,=C2=A0<font face=3D"monospace, monospace"><b>operator||</b></font>, and=
=C2=A0<b style=3D"font-family:monospace,monospace">operator,</b><font face=
=3D"arial, helvetica, sans-serif"> for classes.=C2=A0 The built-in language=
 versions are short-circuiting for &amp;&amp; and || and guarantee left-to-=
right evaluation for comma.</font></div></div></div></div></blockquote><div=
><br>The latter part of that is no longer true in C++17. The order of evalu=
ation for comma is guaranteed regardless of whether it&#39;s calling `opera=
tor,` or using the built-in one:<br><br>&gt; Overloaded operators obey the =
rules for syntax and evaluation order specified in Clause 8, but the requir=
ements of operand type and value category are replaced by the rules for fun=
ction call.<br></div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/9edfd06a-7421-4ce0-80fd-83c436ad7b20%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/9edfd06a-7421-4ce0-80fd-83c436ad7b20=
%40isocpp.org</a>.<br />

------=_Part_101_498146799.1493841572199--

------=_Part_100_88992680.1493841572198--

.
