220 11874 <8209A2E9-D947-4C00-A1F3-38F5676A4E52@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: Sat, 12 Jul 2014 07:30:08 +0800
Lines: 93
Approved: news@gmane.org
Message-ID: <8209A2E9-D947-4C00-A1F3-38F5676A4E52@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> <66c38b61-7a95-4ace-b34f-2346bb334fb9@isocpp.org>
 <F1CBA358-0AD8-4ADD-99DA-6D00FCFE150F@gmail.com> <CAFk2RUZENmaMW5NwBaiF6byfhgRyPUsSmuyVjnRDhbjcfaTtQA@mail.gmail.com>
 <CC03CC1C-8487-40C8-97DF-2CA7661DAD55@gmail.com> <CAFk2RUa7-WTcL=XFYO8KMyU4rdpjDEfFM6n6SkUZ=SW_U7s5XQ@mail.gmail.com>
 <EF930317-EB97-402E-A3A0-CC46E7E2D998@gmail.com> <CAFk2RUZigiwLwFpfVXuFS8cqy38hPG3OGhGUi+iNwSYuYvyAyQ@mail.gmail.com>
 <A46ADDB4-C9B0-4163-81BE-900CD879D8C8@gmail.com> <CAFk2RUZ-DqEcMeehjH8KedYgErxKMq4O9kmeN4FZzjkXMYSsiw@mail.gmail.com>
 <6F4B3C72-9962-48DC-8527-0C89EA1B9710@gmail.com> <CAFk2RUb5xynaoQx-j4cQuXC8t-0GGc9-CZyRA2V=j6cfuNQV=g@mail.gmail.com>
 <35873CE5-ED8C-4C03-A6A1-E4132DECD91F@gmail.com> <CAFk2RUYRJSNcXykj9oPd=3EehSozf7PcX8ACM_hrqhK+Ur2V8A@mail.gmail.com>
 <335948E6-8140-4673-B958-930356A52070@gmail.com> <CAFk2RUYf+tpBvxiK00O=FncB01BWe6+SXiYBN7fixd4mhm+Z-w@mail.gmail.com>
 <76ACA175-5A44-4BE8-B49F-BAC6DA65E6B1@gmail.com> <CAFk2RUah5k9zy_mQqeNN9mec0PYkmKDZp7LVXm64dTeSLaw6nQ@mail.gmail.com>
 <4D3852AD-1AEB-44BA-941C-D645BAD19405@gmail.com> <6a4b6425-1167-40c1-acd8-3945c8cd4c74@isocpp.org>
 <13DD0D7A-A146-4667-9F30-6FB3739CDBE0@gmail.com> <CADGW59=9uFv-fXRVuBCE+3fdycqTzaqCJnuVmmaT6mOF=1=-MA@mail.gmail.com>
 <E9F36B2C-A142-4B6C-ADFD-57D0E11F2C5B@gmail.com> <CAOenAXiBW+BiUkPWdGQHS9fkyEVWJg343NXH9kRSn9owk6FmgQ@mail.gmail.com>
 <DABFDEB7-ADF9-40EC-B4DB-672205A99FEB@gmail.com> <CAFk2RUa-kPWGy29siK4dUu6jbydfwbUeuzCpYOi+b9xc4-msSg@mail.gmail.com>
 <C3BA0F43-683E-4FFE-B04C-9015EB9C7CB0@gmail.com> <CAFk2RUYzt26HjKhYCZtJ4BMrjLzu9MQvZ0ynuaULWTYbE6MBAA@mail.gmail.com>
 <6B925FF7-2940-44C7-BF1D-13209A703BA2@gmail.com> <CAA7U3HOtwZ+9M1E2GUZjmT4J6onk3EdZSnskd-1OaKHv+-wJ7g@mail.gmail.com>
 <944C9C01-865B-4215-8C91-95F01AEA256E@gmail.com> <CAA7U3HPT_z2H3E84v9vOxKhAvCnv2SB2ikJDDkR7W1M+Sd-JSg@mail.gmail.com>
 <8DC3E474-3957-40B2-B492-D4AF2FDDD451@gmail.com> <0ACAE525-4FB2-4932-BBD2-F0623C4EBBFB@gmail.com>
 <52187852-ff8e-4e59-a8cf-7a29fd0a405b@isocpp.org>
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=_1F73ABED-AE92-4FD5-999C-76FF7336FE37"
X-Trace: ger.gmane.org 1405121435 30506 80.91.229.3 (11 Jul 2014 23:30:35 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 11 Jul 2014 23:30:35 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBDXHQGPAKGQEZQR6XNY@isocpp.org Sat Jul 12 01:30:27 2014
Return-path: <std-proposals+bncBCW25A7E3QCRBDXHQGPAKGQEZQR6XNY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f197.google.com ([209.85.192.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBDXHQGPAKGQEZQR6XNY@isocpp.org>)
	id 1X5kGn-0005wM-3h
	for gclcip-std-proposals@m.gmane.org; Sat, 12 Jul 2014 01:30:25 +0200
Original-Received: by mail-pd0-f197.google.com with SMTP id fp1sf10502471pdb.4
        for <gclcip-std-proposals@m.gmane.org>; Fri, 11 Jul 2014 16:30:23 -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=SmAcCZpwcPOFe5ncv9lN6hHjr51F3AdA1uMZrUeCd7U=;
        b=AZK7eEirAIDG0KDvAHut/A8Lm0PT6Nw2p1qdhnd0b1Ku2UlATJd3PhyO87+YCdZ7+p
         odKl2YHqqj5Qc46XqCkgDlXMOEQ3SyslT4tuqVuGtypEqIYfHGvJikk1w/HjDwfCxbd7
         Wj0fZepY5za1DjyX3tqBqqnjp1nEKXQtzS46dJdtT9bs6xIpd7kCBH8tOTuqI1cGA7A7
         SIQ9PlleBz6zLduxSIu3yO+Z6jVti/ARvWZgsZDJmLgLKG8ks3MLapzVm8gkDTKWmyHL
         yEuqpUm+malJ/p+i++3pDoef3FqyIYVOvKbvBiEfB9i9AbHv5vJu+PIU2u2N1wyBKPqt
         NE2g==
X-Gm-Message-State: ALoCoQkgv/5tEyDkX/6SL45PD5GuiObveECggD/RkvTV9Jv9DDPXm+JEquPKqxbHFS3dewzzSA5K
X-Received: by 10.66.155.226 with SMTP id vz2mr967848pab.47.1405121423528;
        Fri, 11 Jul 2014 16:30:23 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.78.136 with SMTP id b8ls563471igx.21.canary; Fri, 11 Jul
 2014 16:30:22 -0700 (PDT)
X-Received: by 10.42.202.136 with SMTP id fe8mr7690930icb.79.1405121422616;
        Fri, 11 Jul 2014 16:30:22 -0700 (PDT)
Original-Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [2607:f8b0:4001:c03::22a])
        by mx.google.com with ESMTPS id yr8si25752igb.45.2014.07.11.16.30.22
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 11 Jul 2014 16:30:22 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:4001:c03::22a as permitted sender) client-ip=2607:f8b0:4001:c03::22a;
Original-Received: by mail-ie0-f170.google.com with SMTP id rl12so146239iec.15
        for <std-proposals@isocpp.org>; Fri, 11 Jul 2014 16:30:22 -0700 (PDT)
X-Received: by 10.42.198.136 with SMTP id eo8mr7756335icb.7.1405121422421;
        Fri, 11 Jul 2014 16:30:22 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.54.139])
        by mx.google.com with ESMTPSA id jc2sm62294igb.19.2014.07.11.16.30.20
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 11 Jul 2014 16:30:22 -0700 (PDT)
In-Reply-To: <52187852-ff8e-4e59-a8cf-7a29fd0a405b@isocpp.org>
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:c03::22a 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:11874
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/11874>

--Apple-Mail=_1F73ABED-AE92-4FD5-999C-76FF7336FE37
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1


On 2014-07-11, at 6:57 PM, tomaszkam@gmail.com wrote:

> Do we found any other argumentation for T member()&& overload except maki=
ng auto&& s =3D f; work for some cases?=20
>=20
> In the follwoing example:
>   template<typename T>
>   delctype(auto) f(T&& t) { return std::addressof(*std::forward<T>(t)); }
>   =20
>   template<typename T>
>   delctype(auto) g(T&& t) {=20
>       auto&& ret =3D f(std::forward<T>(t));=20
>       //will create a dangling pointer, because the liftetime of result o=
f f.value() is not longer same a liftme of the owner t

Once again you've omitted the parens after f in the comment. Please proofre=
ad before posting. f is a naked function and f() is a naked pointer. Neithe=
r can have a member .value. You probably mean *f or f->value() under the as=
sumption that f is type optional*.

A function that converts a possibly-owning smart pointer to merely an obser=
ving naked pointer is obviously not a candidate for move semantics, so the =
example is not reasonable.

I will provide a thorough analysis of value categories, member access expre=
ssions, forwarding contexts, and function calls (or even better, someone el=
se will), but this thread is not the right place.

--=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_1F73ABED-AE92-4FD5-999C-76FF7336FE37
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;11, at 6:57 PM, <a href=3D"mailto:tomaszkam@gmail.com">tomas=
zkam@gmail.com</a> wrote:</div><br class=3D"Apple-interchange-newline"><blo=
ckquote type=3D"cite"><div dir=3D"ltr">Do we found any other argumentation =
for T member()&amp;&amp; overload except making auto&amp;&amp; s =3D f; wor=
k for some cases? <br><br>In the follwoing example:<br>&nbsp; template&lt;t=
ypename T&gt;<br>&nbsp; delctype(auto) f(T&amp;&amp; t) { return std::addre=
ssof(*std::forward&lt;T&gt;(t)); }<br>&nbsp;&nbsp; <br>&nbsp; template&lt;t=
ypename T&gt;<br>&nbsp; delctype(auto) g(T&amp;&amp; t) { <br>&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp; auto&amp;&amp; ret =3D f(std::forward&lt;T&gt;(t)); <br>&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //will create a dangling pointer, because the=
 liftetime of result of f.value() is not longer same a liftme of the owner =
t<br></div></blockquote><div><br></div><div>Once again you&rsquo;ve omitted=
 the parens after f in the comment. Please proofread before posting. f is a=
 naked function and f() is a naked pointer. Neither can have a member <font=
 face=3D"Courier">.value</font>. You probably mean <font face=3D"Courier">*=
f</font> or <font face=3D"Courier">f-&gt;value()</font> under the assumptio=
n that f is type <font face=3D"Courier">optional*</font>.</div><div><br></d=
iv><div>A function that converts a possibly-owning smart pointer to merely =
an observing naked pointer is obviously not a candidate for move semantics,=
 so the example is not reasonable.</div><div><br></div><div>I will provide =
a thorough analysis of value categories, member access expressions, forward=
ing contexts, and function calls (or even better, someone else will), but t=
his thread is not the right place.</div><div><br></div></div></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=_1F73ABED-AE92-4FD5-999C-76FF7336FE37--

.
