220 31913 <9523C82E-3AF8-40ED-9102-B89084FC7D26@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Alberto Barbati <albertobarbati@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: This variable should not be named: an identifier
 (not) to remember
Date: Fri, 31 Mar 2017 08:49:43 +0200
Lines: 72
Approved: news@gmane.org
Message-ID: <9523C82E-3AF8-40ED-9102-B89084FC7D26@gmail.com>
References: <985b9b2a-c734-45eb-95f4-db4dc0d309a1@isocpp.org> <2235919.4GAIbDEcRC@tjmaciei-mobl1> <CAF8PYMgi7mk_fHs=cyYhW4rQad6uDLXrFd7Ef2m7g8Q143p2eg@mail.gmail.com> <3760122.IY8cFr858X@tjmaciei-mobl1> <CAF8PYMgR_=QtP094+ZyER=ymjZQ_TmtbU7eYYh9wLWDV-FmzJw@mail.gmail.com> <CAF8PYMi+6VjCUvVTTvVKOCg9xTxV8mS8CLz3VpLLpqVpKYzzhA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0 (1.0)
Content-Type: multipart/alternative;
	boundary=Apple-Mail-8BD016DC-4DF2-4AB4-81DA-85B1E644EB70
Content-Transfer-Encoding: 7bit
X-Trace: blaine.gmane.org 1490942992 28509 195.159.176.226 (31 Mar 2017 06:49:52 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 31 Mar 2017 06:49:52 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCPY5DV6RIMBBCXY67DAKGQE4BNC3RI@isocpp.org Fri Mar 31 08:49:48 2017
Return-path: <std-proposals+bncBCPY5DV6RIMBBCXY67DAKGQE4BNC3RI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f71.google.com ([209.85.215.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCPY5DV6RIMBBCXY67DAKGQE4BNC3RI@isocpp.org>)
	id 1ctqNR-0006Iu-0Z
	for gclcip-std-proposals@m.gmane.org; Fri, 31 Mar 2017 08:49:41 +0200
Original-Received: by mail-lf0-f71.google.com with SMTP id f66sf14029065lfe.23
        for <gclcip-std-proposals@m.gmane.org>; Thu, 30 Mar 2017 23:49:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=content-transfer-encoding:from:mime-version:date:message-id:subject
         :in-reply-to:references: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=XKrpKtzFtzybQcZGhq/v8d4wyctm4HEVDUUlcoXXxl4=;
        b=ESwaQnTnZsXVK1vsqmLAnbfQCUtn2y80Q3pF4x56IxH9DkTIQkdMGoH5JON2Gy5PH6
         mPfnAOvmMyfuXd66mwIMUMZl+WepIGS8Bv0QxVqxJQAOdTKC91V4vGsrZdmbbno4NDNQ
         FloDTqyVruBI/2gf98s/f5HSXMydJb3bl8Iq9pOa4VlO/cwHOVocgzk6LsFvQshVqq+b
         Qrs1aZVuKmO6rBc5Dfx7eY5thLSFBKeo/jZlbw+TBrTuH0RikIycISPDoNg7BQTcVDFs
         gqVVp8SjJUaGCgQZFjjKr2rJDZgIBZb/QJr0mLHq+CnNrjN9AmWmQVnPlXRRH2lwxGqf
         KHPA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:content-transfer-encoding:from:mime-version:date
         :message-id:subject:in-reply-to:references: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=XKrpKtzFtzybQcZGhq/v8d4wyctm4HEVDUUlcoXXxl4=;
        b=Z29epXSpjh84bRFqZI372epDAYWt5L5N00VXP7q0tmx1eIOTUUKiVrKwea4XasTGxp
         QvwJTl3XbaoDaRUxmj1CoFqb3GmKgMXprY6KXNY9CX5b9DPFChYzBctu+2Lh/Bqql6zI
         T97S9NioZWia+mtnVlQrbeqdUSvl7r9yE35pfLi0cTOwCf8xrnR7e1N2Wz9cigvhJGLG
         jv4NX59dgIFpoYt4/CNjoQYp22iLhyw9fxgljzek4O0xy8Q9vS+EoPXYrqK6mBv7dmhV
         RS9HZnygQL2TDQYwq3ModHW8NqWmx3HkeFz3kN0qB/8f1BVLp6JfwnMRJEriwVAAowr5
         DMf 
X-Gm-Message-State: AFeK/H0nGUHzc9KeuIXgHrPVwLu1Ed6Ze/5hQaVPo4GxxLZvgHpvgAVuqG4ZarNUPtfmSg==
X-Received: by 10.46.71.19 with SMTP id u19mr426485lja.7.1490942987275;
        Thu, 30 Mar 2017 23:49:47 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.184.4 with SMTP id i4ls3177503wmf.21.gmail; Thu, 30 Mar
 2017 23:49:45 -0700 (PDT)
X-Received: by 10.28.214.149 with SMTP id n143mr1569518wmg.127.1490942985744;
        Thu, 30 Mar 2017 23:49:45 -0700 (PDT)
Original-Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com. [2a00:1450:400c:c0c::22a])
        by mx.google.com with ESMTPS id m197si2095299wmd.63.2017.03.30.23.49.45
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 30 Mar 2017 23:49:45 -0700 (PDT)
Received-SPF: pass (google.com: domain of albertobarbati@gmail.com designates 2a00:1450:400c:c0c::22a as permitted sender) client-ip=2a00:1450:400c:c0c::22a;
Original-Received: by mail-wr0-x22a.google.com with SMTP id w11so90204908wrc.3
        for <std-proposals@isocpp.org>; Thu, 30 Mar 2017 23:49:45 -0700 (PDT)
X-Received: by 10.28.113.12 with SMTP id m12mr1741622wmc.18.1490942985188;
        Thu, 30 Mar 2017 23:49:45 -0700 (PDT)
Original-Received: from [1.137.172.222] ([91.253.168.84])
        by smtp.gmail.com with ESMTPSA id c8sm5482188wrd.57.2017.03.30.23.49.44
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 30 Mar 2017 23:49:44 -0700 (PDT)
In-Reply-To: <CAF8PYMi+6VjCUvVTTvVKOCg9xTxV8mS8CLz3VpLLpqVpKYzzhA@mail.gmail.com>
X-Mailer: iPhone Mail (14D27)
X-Original-Sender: AlbertoBarbati@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 albertobarbati@gmail.com designates 2a00:1450:400c:c0c::22a as permitted
 sender) smtp.mailfrom=albertobarbati@gmail.com;       dmarc=pass (p=NONE
 sp=NONE dis=NONE) header.from=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:31913
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31913>


--Apple-Mail-8BD016DC-4DF2-4AB4-81DA-85B1E644EB70
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable


> Il giorno 30 mar 2017, alle ore 23:41, Vitali Lovich <vlovich@gmail.com> =
ha scritto:
>=20
> Ah. But I forgot now that with structured binding there's a hidden local =
variable anyway for the tuple itself.  I was thinking the compiler was smar=
t and applied RVO to the individual elements directly.

Exactly. All RAII logic is (or at least should be) performed by the "main" =
hidden object that is being decomposed. No get() function should ever depen=
d on the side effects of other get() function on the same object, because o=
therwise the following valid code would become problematic:

auto x =3D getstr();
auto v =3D get<1>(x);

A.=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/9523C82E-3AF8-40ED-9102-B89084FC7D26%40gmail.com=
..

--Apple-Mail-8BD016DC-4DF2-4AB4-81DA-85B1E644EB70
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=
=3Dutf-8"></head><body dir=3D"auto"><div><span></span></div><div><meta http=
-equiv=3D"content-type" content=3D"text/html; charset=3Dutf-8"><div><br></d=
iv><div>Il giorno 30 mar 2017, alle ore 23:41, Vitali Lovich &lt;<a href=3D=
"mailto:vlovich@gmail.com">vlovich@gmail.com</a>&gt; ha scritto:<br><br></d=
iv><blockquote type=3D"cite"><div><div>Ah. But I forgot now that with struc=
tured binding there's a hidden local variable anyway for the tuple itself.&=
nbsp; I was thinking the compiler was smart and applied RVO to the individu=
al elements directly.</div></div></blockquote><div><br></div>Exactly. All R=
AII logic is (or at least should be) performed by the "main" hidden object =
that is being decomposed. No get() function should ever depend on the side =
effects of other get() function on the same object, because otherwise the f=
ollowing valid code would become problematic:<div><br></div><div>auto x =3D=
&nbsp;<span style=3D"background-color: rgba(255, 255, 255, 0);">getstr();</=
span></div><div>auto v =3D get&lt;1&gt;(x);</div><div><br></div><div>A.&nbs=
p;</div></div></body></html>

<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/9523C82E-3AF8-40ED-9102-B89084FC7D26%=
40gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/9523C82E-3AF8-40ED-9102-B89084FC7D26%=
40gmail.com</a>.<br />

--Apple-Mail-8BD016DC-4DF2-4AB4-81DA-85B1E644EB70--

.
