220 36468 <55bb7162-834a-4ba4-bd68-915470842430@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: olafvdspek@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Treating local variables as rvalues in return statements
Date: Wed, 3 Jan 2018 02:51:05 -0800 (PST)
Lines: 63
Approved: news@gmane.org
Message-ID: <55bb7162-834a-4ba4-bd68-915470842430@isocpp.org>
References: <4ff5fe2d-0945-491f-9888-479b8e866ace@isocpp.org>
 <d5b5434c-6300-4f82-92b4-a439696d6020@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2553_329857212.1514976665987"
X-Trace: blaine.gmane.org 1514976552 14027 195.159.176.226 (3 Jan 2018 10:49:12 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 3 Jan 2018 10:49:12 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5NB45SSABBBGXLWLJAKGQEVKGQYEY@isocpp.org Wed Jan 03 11:49:08 2018
Return-path: <std-proposals+bncBC5NB45SSABBBGXLWLJAKGQEVKGQYEY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ot0-f200.google.com ([74.125.82.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5NB45SSABBBGXLWLJAKGQEVKGQYEY@isocpp.org>)
	id 1eWgbY-00039n-EX
	for gclcip-std-proposals@m.gmane.org; Wed, 03 Jan 2018 11:49:04 +0100
Original-Received: by mail-ot0-f200.google.com with SMTP id r31sf603969otc.9
        for <gclcip-std-proposals@m.gmane.org>; Wed, 03 Jan 2018 02:51:08 -0800 (PST)
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
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=lGwom5ZtM9hmxQBcM1m8fxveSLJoBaOfEFuoYE4FG3M=;
        b=YBgiOmbPNVTI6p/alsJp74XoeTgYqt4sMuHOx61n5g68FSSHm6ucS7xbOKcYKVFTrn
         f8CHHTzNx7t+ND9lhrVklR0xbLTLJU5fPPixDhZhf2DES62pk6oA5U+w3H9HfpwXkJLp
         J3xbFjfOenTwb5d5O6VS5AD4k3ToGBNuysy4ufG+Gqf0zj8pqSvLR2/KofL1tM5W+aTw
         BqKKUNGK/3pzRgX46TKiWpSgutuQNK9X62sA0S2aw10KG3Ny2mrQFjvHF3yDVx58EuKs
         tBy3yBjBWgVPNsqsmDCPS35VwSTPkrpsl1rI0lCEqWGtKyB7IKUUkcftbY/nNijSzOgr
         KPFQ==
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
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=lGwom5ZtM9hmxQBcM1m8fxveSLJoBaOfEFuoYE4FG3M=;
        b=LvunA/ozpzJDAqn5UF7d4oP8v4P4BI/LjEYZPDXKG3FnaiGY1cCFrXOHxxNWSIJzQE
         +yIHo2YTBtLMh1GBsLDZIJnlyC/QsGz77D+jPsawTK5uA4fv9b681OGrZCiWLCnCDJzS
         WZ5rk4FE8Sim9fdlyvbhzrsPdOJv+iSjrzE5Tw1XL90I5Td8aCx0w9qMhugllJSdeVjD
         dE2wAug4AUZdwhcV5HOFMtyeWZqDzpIXr8klOLFccBtKY9eyEvgWwAxmrDYy25bvOf9T
         iu65Nv61wEO62p4A0Dizo8afKjFGiCnLoQ2esnigK39kET//8JZ79aiEFGATJ1jMMRgE
         V6UA==
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=lGwom5ZtM9hmxQBcM1m8fxveSLJoBaOfEFuoYE4FG3M=;
        b=Q4w6wdxqIt3xHX5b/qBSTbcu5ZhMT/P2bUKGGe6oC2eaqLVnWZUeHEpIq0OqF+LOtG
         92LUefCNRpIUh64G+z3ivoCIM7zAIFghPiF9sdoNctAAZtccLa08dUPKwT8a7oJcKok+
         m/LCwPZ0rBzh8PjhyFUmEdD1vrVN9RPMgcPwWGY0/w9Kdg4x+RDSv4Svj1pdDfBRHQVx
         sVlW10P5fF5D17Wh4NZ26o7UKMT+TSarvEtSGMNm1vyZkgzWT3urQqEMCeeJe+wc7lyO
         bx/jHe/ONhv8H2o0pmNV/Gux14U4QA/6Q+o6blptfnZSnX1b7FQ+IveDXunuqVCgf4Ew
         xpgA==
X-Gm-Message-State: AKGB3mJX+oWeCoedh06qpTT/25PIaC94PHGLVt5UiNCtfpAU3hgNVGcn
	Fpo6qPj6/vgJzziwmHUkhLFH0g==
X-Google-Smtp-Source: ACJfBouduItQIu1qxVh7hvSfzIlJZ4P1Ts7tz77sbP8MDyOZvyPhDiuEdIC0OL/JewFHirweDRA3kA==
X-Received: by 10.157.17.229 with SMTP id y34mr444211oty.52.1514976667511;
        Wed, 03 Jan 2018 02:51:07 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.202.48.151 with SMTP id w145ls7338552oiw.9.gmail; Wed, 03 Jan
 2018 02:51:06 -0800 (PST)
X-Received: by 10.157.82.97 with SMTP id q33mr64516otg.7.1514976666509;
        Wed, 03 Jan 2018 02:51:06 -0800 (PST)
In-Reply-To: <d5b5434c-6300-4f82-92b4-a439696d6020@isocpp.org>
X-Original-Sender: olafvdspek@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:36468
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36468>

------=_Part_2553_329857212.1514976665987
Content-Type: multipart/alternative; 
	boundary="----=_Part_2554_1975210151.1514976665987"

------=_Part_2554_1975210151.1514976665987
Content-Type: text/plain; charset="UTF-8"



Op dinsdag 26 december 2017 04:17:12 UTC+1 schreef Nicol Bolas:
>
> But with your proposal, it isn't. If `compute(str)` has an rvalue overload 
> or an overload that takes a `string` by value, then these two pieces of 
> code will have fundamentally different behavior. Specifically, it will have* 
> undefined* behavior, since `str` will have been moved from by the time 
> `operator+` gets called on it.
>

Wouldn't the idea be to do the analysis and only consider it a rvalue if 
it's NOT accessed later in the statement / function? 

-- 
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/55bb7162-834a-4ba4-bd68-915470842430%40isocpp.org.

------=_Part_2554_1975210151.1514976665987
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>Op dinsdag 26 december 2017 04:17:12 UTC+1 schreef=
 Nicol Bolas:<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">=
<div>But with your proposal, it isn&#39;t. If `compute(str)` has an rvalue =
overload or an overload that takes a `string` by value, then these two piec=
es of code will have fundamentally different behavior. Specifically, it wil=
l have<i> undefined</i> behavior, since `str` will have been moved from by =
the time `operator+` gets called on it.</div></div></blockquote><div><br></=
div><div>Wouldn&#39;t the idea be to do the analysis and only consider it a=
 rvalue if it&#39;s NOT accessed later in the statement / function?=C2=A0</=
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/55bb7162-834a-4ba4-bd68-915470842430%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/55bb7162-834a-4ba4-bd68-915470842430=
%40isocpp.org</a>.<br />

------=_Part_2554_1975210151.1514976665987--

------=_Part_2553_329857212.1514976665987--

.
