220 31821 <CAGsORuBepjjTQxa0w+9Z_v+irrc6QwxqmUv98dTRarUCVHHY+A@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Zhihao Yuan <zy@miator.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: This variable should not be named: an identifier
 (not) to remember
Date: Tue, 28 Mar 2017 11:53:51 -0500
Lines: 106
Approved: news@gmane.org
Message-ID: <CAGsORuBepjjTQxa0w+9Z_v+irrc6QwxqmUv98dTRarUCVHHY+A@mail.gmail.com>
References: <985b9b2a-c734-45eb-95f4-db4dc0d309a1@isocpp.org>
 <CAF3xnJSBMmyno-AksyJJz5W=K4J=uY-ynYys3+v=mf5EzCp07w@mail.gmail.com>
 <CAGsORuC7LZWWtCnr9Zuoqc=zzQOeNT-KZimy6BNO+u_h3in6cA@mail.gmail.com> <14211602.1P4LjlnQMh@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=94eb2c1aaab8f7e8d1054bcd4d1c
X-Trace: blaine.gmane.org 1490720042 8918 195.159.176.226 (28 Mar 2017 16:54:02 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 28 Mar 2017 16:54:02 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCSKRWMD4EHBBIVK5LDAKGQEU2LHXLA@isocpp.org Tue Mar 28 18:53:57 2017
Return-path: <std-proposals+bncBCSKRWMD4EHBBIVK5LDAKGQEU2LHXLA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f69.google.com ([74.125.83.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCSKRWMD4EHBBIVK5LDAKGQEU2LHXLA@isocpp.org>)
	id 1csuNR-000161-F2
	for gclcip-std-proposals@m.gmane.org; Tue, 28 Mar 2017 18:53:49 +0200
Original-Received: by mail-pg0-f69.google.com with SMTP id u3sf116861562pgn.12
        for <gclcip-std-proposals@m.gmane.org>; Tue, 28 Mar 2017 09:53:55 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:sender:mime-version:in-reply-to:references:from
         :date:message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=jOZaG9BXbzCFEzqn6g2QoNauAgHulZ/cftcWuC0TL0c=;
        b=U12271bnyjSh5WfR7DUwOxAc0Fe+hnwUjnDurlpnC9qGuLeUiSZoasRFFnqWjFnrQG
         dTfFkeBZPtDJ+YjrnLWP2W+sP5NgkRDoQENqdJdCTmJCkPMQlM8YNzrwiw0BjaSROIb6
         +UgGF4awcVZ2O17t+1msPjUzftUOfzwVvj+bPUubWbyxezoWNoyoGN6j1vxgg8Lm3xZu
         MQE37oG+Fb0DTAajYDjKlH77oVi6miysDiUmacAo8VD27rLmvhior2Ie2JV5vqqFALrt
         6AO1e+84d0VbU6a+MdKzYYHBBDl/oCtc2Xy/FVkjOczuaV6DsloFf+09dugMKUcqH2Lu
         oCtg==
X-Gm-Message-State: AFeK/H0oIOf2KQCMTG5UES9YRQpIxCUhZtwrSd4uXEYqqGrbaZOEBPmYRpD2D6pBvi3aPQ==
X-Received: by 10.99.115.16 with SMTP id o16mr9076978pgc.63.1490720035224;
        Tue, 28 Mar 2017 09:53:55 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.47.171 with SMTP id r40ls5864770otb.0.gmail; Tue, 28 Mar
 2017 09:53:54 -0700 (PDT)
X-Received: by 10.237.43.162 with SMTP id e31mr30015068qtd.189.1490720034313;
        Tue, 28 Mar 2017 09:53:54 -0700 (PDT)
Original-Received: from mail-s68.mailgun.info (mail-s68.mailgun.info. [184.173.153.196])
        by mx.google.com with ESMTPS id y5si3891325qkc.328.2017.03.28.09.53.53
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 28 Mar 2017 09:53:53 -0700 (PDT)
Received-SPF: pass (google.com: domain of bounce+3f9131.69110-std-proposals=isocpp.org@miator.net designates 184.173.153.196 as permitted sender) client-ip=184.173.153.196;
Original-Sender: zy@miator.net
X-Mailgun-Sending-Ip: 184.173.153.196
X-Mailgun-Sid: WyI3MTBkYiIsICJzdGQtcHJvcG9zYWxzQGlzb2NwcC5vcmciLCAiNjkxMTAiXQ==
Original-Received: from mail-pg0-f50.google.com (mail-pg0-f50.google.com [74.125.83.50])
 by mxa.mailgun.org with ESMTP id 58da9520.7fcc001adab0-smtp-out-n03;
 Tue, 28 Mar 2017 16:53:52 -0000 (UTC)
Original-Received: by mail-pg0-f50.google.com with SMTP id 21so78043303pgg.1
        for <std-proposals@isocpp.org>; Tue, 28 Mar 2017 09:53:52 -0700 (PDT)
X-Received: by 10.84.210.167 with SMTP id a36mr37313877pli.40.1490720032021;
 Tue, 28 Mar 2017 09:53:52 -0700 (PDT)
Original-Received: by 10.100.159.10 with HTTP; Tue, 28 Mar 2017 09:53:51 -0700 (PDT)
In-Reply-To: <14211602.1P4LjlnQMh@tjmaciei-mobl1>
X-Gmail-Original-Message-ID: <CAGsORuBepjjTQxa0w+9Z_v+irrc6QwxqmUv98dTRarUCVHHY+A@mail.gmail.com>
X-Original-Sender: zy@miator.net
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@miator.net;       spf=pass (google.com: domain of
 bounce+3f9131.69110-std-proposals=isocpp.org@miator.net designates
 184.173.153.196 as permitted sender) smtp.mailfrom=bounce+3f9131.69110-std-proposals=isocpp.org@miator.net
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:31821
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31821>

--94eb2c1aaab8f7e8d1054bcd4d1c
Content-Type: text/plain; charset=UTF-8

On Tue, Mar 28, 2017 at 11:43 AM, Thiago Macieira <thiago@macieira.org>
wrote:

> just like std::ignore, I don't expect __ here
> > to issue a call to get(obj), nor an access to a subobject.
> > I don't think the *preserving* semantics can fulfill the
> > *ignoring* demand.
>
> It has no difference, because the structured binding is actually a
> *binding*,
> so there's difference to object creation or retention. The result from
> get_tuple is assigned to an anonymous object and all its members are
> retained.
> Then it's decomposed into two elements: an anonymous one (can't be
> accessed)
> and a.
>

Whether a call to get<0>(anon) being made
certainly has difference, because it can have
observable effect.  And, just like I showed
in a previous discussion, the purpose of the
anonymous object is for decomposition.  If
nothing is decomposition it, it needs not to be
created, therefore

  auto [__, __] = get_tuple(...);

should be physically equivalent to

  get_tuple(...);

thus, the result object is dropped on the floor.

-- 
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________

-- 
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/CAGsORuBepjjTQxa0w%2B9Z_v%2Birrc6QwxqmUv98dTRarUCVHHY%2BA%40mail.gmail.com.

--94eb2c1aaab8f7e8d1054bcd4d1c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
On Tue, Mar 28, 2017 at 11:43 AM, Thiago Macieira <span dir=3D"ltr">&lt;<a =
href=3D"mailto:thiago@macieira.org" target=3D"_blank">thiago@macieira.org</=
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"><span class=3D"">jus=
t like std::ignore, I don&#39;t expect __ here<br>
&gt; to issue a call to get(obj), nor an access to a subobject.<br>
&gt; I don&#39;t think the *preserving* semantics can fulfill the<br>
&gt; *ignoring* demand.<br>
<br>
</span>It has no difference, because the structured binding is actually a *=
binding*,<br>
so there&#39;s difference to object creation or retention. The result from<=
br>
get_tuple is assigned to an anonymous object and all its members are retain=
ed.<br>
Then it&#39;s decomposed into two elements: an anonymous one (can&#39;t be =
accessed)<br>
and a.<br>
<span class=3D""></span></blockquote></div><br></div><div class=3D"gmail_ex=
tra">Whether a call to get&lt;0&gt;(anon) being made<br>certainly has diffe=
rence, because it can have<br>observable effect.=C2=A0 And, just like I sho=
wed<br></div><div class=3D"gmail_extra">in a previous discussion, the purpo=
se of the<br>anonymous object is for decomposition.=C2=A0 If<br>nothing is =
decomposition it, it needs not to be<br>created, therefore<br><br></div><di=
v class=3D"gmail_extra">=C2=A0 auto [__, __] =3D get_tuple(...);<br><br></d=
iv><div class=3D"gmail_extra">should be physically equivalent to<br><br></d=
iv><div class=3D"gmail_extra">=C2=A0 get_tuple(...);<br><br></div><div clas=
s=3D"gmail_extra">thus, the result object is dropped on the floor.<br clear=
=3D"all"></div><div class=3D"gmail_extra"><br>-- <br><div class=3D"gmail_si=
gnature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=
=3D"ltr"><div>Zhihao Yuan, ID lichray<br>The best way to predict the future=
 is to invent it.<br>___________________________________________________<br=
></div></div></div></div></div>
</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&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/CAGsORuBepjjTQxa0w%2B9Z_v%2Birrc6Qwxq=
mUv98dTRarUCVHHY%2BA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAGsORuBepj=
jTQxa0w%2B9Z_v%2Birrc6QwxqmUv98dTRarUCVHHY%2BA%40mail.gmail.com</a>.<br />

--94eb2c1aaab8f7e8d1054bcd4d1c--

.
