220 11785 <3EF9F5C2-EF9D-4DC5-9F53-82CA1155D4DF@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: N4078: Rvalue reference overloads for value()
 method returns object by value
Date: Thu, 10 Jul 2014 14:22:42 +0800
Lines: 86
Approved: news@gmane.org
Message-ID: <3EF9F5C2-EF9D-4DC5-9F53-82CA1155D4DF@gmail.com>
References: <b538efba-faf4-4ffc-a553-302b9d2ba2c0@isocpp.org> <CANh-dX=M7niArNp-1sCcqxaREEJSxmjMftgw7uMHN9YnZC-h+w@mail.gmail.com> <4DA018C3-2327-4F55-B7F8-7988EC7B789A@gmail.com> <1a858a77-310b-4591-aaf5-960c40d9f5fc@isocpp.org> <66AF41C1-CB37-4311-98EA-D47DBC6068DC@gmail.com> <CAFk2RUa5foB0ySVSjfc3t6cBOWE-+Qt76jnRv3X=FHP6ntpPjw@mail.gmail.com> <F80F564C-1208-4A65-AA1F-382144A3D16A@gmail.com> <CAFk2RUYEdZn6t72-ajwY2z4PVLN_wQc12EMX3ycVS12p6+QYxA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_624E72F2-A725-4634-BC33-269A15A4996B"
X-Trace: ger.gmane.org 1404973377 27320 80.91.229.3 (10 Jul 2014 06:22:57 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 10 Jul 2014 06:22:57 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBNXC7COQKGQE6Q4HQ2A@isocpp.org Thu Jul 10 08:22:49 2014
Return-path: <std-proposals+bncBCW25A7E3QCRBNXC7COQKGQE6Q4HQ2A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qc0-f200.google.com ([209.85.216.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBNXC7COQKGQE6Q4HQ2A@isocpp.org>)
	id 1X57km-0003OD-5Y
	for gclcip-std-proposals@m.gmane.org; Thu, 10 Jul 2014 08:22:48 +0200
Original-Received: by mail-qc0-f200.google.com with SMTP id x13sf1796880qcv.7
        for <gclcip-std-proposals@m.gmane.org>; Wed, 09 Jul 2014 23:22:47 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:mime-version:subject:date
         :references:to:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=6j2y9QxNCktLP79Fl592QNrdUeOlTm0Hlk5rUHluv3M=;
        b=AU5e0XKb3Zb5fFLiMCNWuOIA2AZVdglF4SwMPyr0GxOl0/G5KkyEDohrbJrV2rjSB3
         BH0Ivz2FT5UgGtHYc58p1DQeh+GzxO6tZYXHCJI3pJ8MJwSanhLwM95SWskU85/lWmXj
         QVMnovxyPa8lpXSWujRM9yiJ7ozs1GpeczTmz61Rg2AYJ3h/rTKLqHTPdgp+vbU+BoMr
         5uJQMRa+W859vzizcq1bbABnqT7DsF9IJ9PbWI/U8rueux/NjQjcy7NHhbeyHUYujsqE
         bM+F7NFIuBzlWnLm1pucPy3LA2hiJLgDYZTXaJpkItOrucLxeDskFHwgzngzHOo02+bD
         Ozhw==
X-Gm-Message-State: ALoCoQkfgSSosRnKieb5uWlROLK0w4+lOYTXb1qI4PMxUI1Hzi+pgahuHhnXGydzZX4s8enRsNs4
X-Received: by 10.236.204.38 with SMTP id g26mr19367817yho.43.1404973367101;
        Wed, 09 Jul 2014 23:22:47 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.117.7 with SMTP id ka7ls3735igb.32.gmail; Wed, 09 Jul 2014
 23:22:46 -0700 (PDT)
X-Received: by 10.43.133.201 with SMTP id hz9mr75130icc.95.1404973366461;
        Wed, 09 Jul 2014 23:22:46 -0700 (PDT)
Original-Received: from mail-ig0-x22e.google.com (mail-ig0-x22e.google.com [2607:f8b0:4001:c05::22e])
        by mx.google.com with ESMTPS id dy8si22872061icc.71.2014.07.09.23.22.46
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 09 Jul 2014 23:22:46 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:4001:c05::22e as permitted sender) client-ip=2607:f8b0:4001:c05::22e;
Original-Received: by mail-ig0-f174.google.com with SMTP id c1so2728742igq.13
        for <std-proposals@isocpp.org>; Wed, 09 Jul 2014 23:22:46 -0700 (PDT)
X-Received: by 10.50.126.7 with SMTP id mu7mr19471430igb.20.1404973366314;
        Wed, 09 Jul 2014 23:22:46 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.54.63])
        by mx.google.com with ESMTPSA id jf5sm22409916igb.2.2014.07.09.23.22.44
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 09 Jul 2014 23:22:45 -0700 (PDT)
In-Reply-To: <CAFk2RUYEdZn6t72-ajwY2z4PVLN_wQc12EMX3ycVS12p6+QYxA@mail.gmail.com>
X-Mailer: Apple Mail (2.1878.6)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 2607:f8b0:4001:c05::22e as permitted
 sender) smtp.mail=potswa@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=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: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:11785
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11785>

--Apple-Mail=_624E72F2-A725-4634-BC33-269A15A4996B
Content-Type: text/plain; charset=ISO-8859-1


On 2014-07-10, at 2:17 PM, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:

>> Returning by rvalue reference may be tempting, but that is the semantic of
>> move(). It does not transfer ownership, it only provides the caller with a
>> handle to accept ownership. Returning an rvalue reference is something only
>> special functions should do.
> 
> I have no idea where this guideline popped out of.

Which part? Name three functions that return an rvalue reference. There's move(), forward(), and ??? .

>> Then perhaps we need more cases for copy elision. Sneaky rvalue reference
>> hacks will only provide surprises and make user code more brittle. If there
>> must be an rvalue reference overload, it should be named move_value() to
>> indicate the different semantic.
> 
> 
> That would be equally detrimental to users who want to forward.

So, call it forward_value() with appropriate semantics. It's equally a bad idea to bind a named reference to move() or forward().

-- 

--- 
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/.

--Apple-Mail=_624E72F2-A725-4634-BC33-269A15A4996B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-=
mode: space; -webkit-line-break: after-white-space;"><br><div><div>On 2014&=
ndash;07&ndash;10, at 2:17 PM, Ville Voutilainen &lt;<a href=3D"mailto:vill=
e.voutilainen@gmail.com">ville.voutilainen@gmail.com</a>&gt; wrote:</div><b=
r><blockquote type=3D"cite"><div style=3D"font-size: 12px; font-style: norm=
al; font-variant: normal; font-weight: normal; letter-spacing: normal; line=
-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-t=
ransform: none; white-space: normal; widows: auto; word-spacing: 0px; -webk=
it-text-stroke-width: 0px;"><blockquote type=3D"cite">Returning by rvalue r=
eference may be tempting, but that is the semantic of<br>move(). It does no=
t transfer ownership, it only provides the caller with a<br>handle to accep=
t ownership. Returning an rvalue reference is something only<br>special fun=
ctions should do.<br></blockquote><br>I have no idea where this guideline p=
opped out of.<br></div></blockquote><div><br></div><div>Which part? Name th=
ree functions that return an rvalue reference. There&rsquo;s move(), forwar=
d(), and ??? .</div><br><blockquote type=3D"cite"><div style=3D"font-size: =
12px; font-style: normal; font-variant: normal; font-weight: normal; letter=
-spacing: normal; line-height: normal; orphans: auto; text-align: start; te=
xt-indent: 0px; text-transform: none; white-space: normal; widows: auto; wo=
rd-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type=3D"cite"=
>Then perhaps we need more cases for copy elision. Sneaky rvalue reference<=
br>hacks will only provide surprises and make user code more brittle. If th=
ere<br>must be an rvalue reference overload, it should be named move_value(=
) to<br>indicate the different semantic.<br></blockquote><br><br>That would=
 be equally detrimental to users who want to forward.<br></div></blockquote=
><div><br></div><div>So, call it <font face=3D"Courier">forward_value()</fo=
nt> with appropriate semantics. It&rsquo;s equally a bad idea to bind a nam=
ed reference to <font face=3D"Courier">move()</font> or <font face=3D"Couri=
er">forward()</font>.</div></div><br></body></html>

<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 />

--Apple-Mail=_624E72F2-A725-4634-BC33-269A15A4996B--

.
