220 19954 <0FD6863F-4615-4A5C-867E-50F561844665@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: Address of a reference: determining the value
 category of what it refers?
Date: Sat, 22 Aug 2015 09:37:36 +0800
Lines: 104
Approved: news@gmane.org
Message-ID: <0FD6863F-4615-4A5C-867E-50F561844665@gmail.com>
References: <76fe342f-3342-4355-af20-1c41b21e54aa@isocpp.org> <CANh8DEk8mVDWksjmej6BbHw3GH0Rhqfp0XpQq2RORtj6fcDHXw@mail.gmail.com> <1115b787-4cfd-4052-9f49-ece9c4bdf2ec@isocpp.org> <CAOfiQqnohbBZt9OguvL8Tg=9cDPzEzTPC_hAkdErM9T_mnH6vw@mail.gmail.com> <d48969a2-f27a-4c82-869e-6a848c9f1422@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_582A9A05-5F6D-4BCA-821D-D4FB888C917A"
X-Trace: ger.gmane.org 1440207470 21263 80.91.229.3 (22 Aug 2015 01:37:50 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 22 Aug 2015 01:37:50 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBZ5E36XAKGQEC7GY5WA@isocpp.org Sat Aug 22 03:37:44 2015
Return-path: <std-proposals+bncBCW25A7E3QCRBZ5E36XAKGQEC7GY5WA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f197.google.com ([209.85.213.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBZ5E36XAKGQEC7GY5WA@isocpp.org>)
	id 1ZSxke-0005Oy-OZ
	for gclcip-std-proposals@m.gmane.org; Sat, 22 Aug 2015 03:37:44 +0200
Original-Received: by igcse8 with SMTP id se8sf52540332igc.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 21 Aug 2015 18:37:43 -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:content-type: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:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=Fpv1ZiuNAFcW158C0aFyIUIX1AJS52oPF9zJOJfjQz0=;
        b=Z+wNdBxhd/Jh/CMQvx4Fv/ZCU/Ik/7f4Y+mop4dYoN8YtSFWKKl56fqiA/OMdr705T
         GC7Pt5nuW/EfuX4iS4x7CSjQthSrGim2dvuJUJqgCqdAwjoIorjyqV52L5Ekxok8HNTS
         7Pt2TvRidMDdX8Tp8UN/0RRiKJqOJgDUk1M1lmaCA2G6ORtgluYAzqHPSMdkEaPB3dRM
         bpUk4B2/TaRHEVneb3DfyDzYMYRHkZaLPrf4bc4VzZgJXndyB8mKiqq9nnejuxg1HUYh
         swNyPybzxn6PRIYsbGIg+nKKTLEr7gqyecb663yj8NEnW6fu2KtLTcKl+zQXSVFXD17D
         GGsQ==
X-Gm-Message-State: ALoCoQlvdNHUuaipHBYqPBFlFj5MhteYoOj2XVwasi/F7Z/C7njbtkxr/sdmwIlyrjx33rXB3JAC
X-Received: by 10.182.48.232 with SMTP id p8mr9104546obn.43.1440207463899;
        Fri, 21 Aug 2015 18:37:43 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.73.129 with SMTP id l1ls652595igv.31.gmail; Fri, 21 Aug
 2015 18:37:43 -0700 (PDT)
X-Received: by 10.66.244.230 with SMTP id xj6mr23022389pac.53.1440207463218;
        Fri, 21 Aug 2015 18:37:43 -0700 (PDT)
Original-Received: from mail-pd0-x22f.google.com (mail-pd0-x22f.google.com. [2607:f8b0:400e:c02::22f])
        by mx.google.com with ESMTPS id b1si15777170pat.26.2015.08.21.18.37.43
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 21 Aug 2015 18:37:43 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:400e:c02::22f as permitted sender) client-ip=2607:f8b0:400e:c02::22f;
Original-Received: by pdrh1 with SMTP id h1so32653693pdr.0
        for <std-proposals@isocpp.org>; Fri, 21 Aug 2015 18:37:43 -0700 (PDT)
X-Received: by 10.70.23.196 with SMTP id o4mr22990823pdf.1.1440207462832;
        Fri, 21 Aug 2015 18:37:42 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.44.93])
        by smtp.gmail.com with ESMTPSA id wf3sm9215271pab.9.2015.08.21.18.37.40
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 21 Aug 2015 18:37:42 -0700 (PDT)
In-Reply-To: <d48969a2-f27a-4c82-869e-6a848c9f1422@isocpp.org>
X-Mailer: Apple Mail (2.2098)
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:400e:c02::22f as permitted
 sender) smtp.mailfrom=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-Spam-Checked-In-Group: 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:19954
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19954>

--Apple-Mail=_582A9A05-5F6D-4BCA-821D-D4FB888C917A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9308=E2=80=9322, at 9:21 AM, NDos Dannyu <ndospark320@naver=
..com> wrote:
>=20
> 2015=EB=85=84 8=EC=9B=94 22=EC=9D=BC =ED=86=A0=EC=9A=94=EC=9D=BC =EC=98=
=A4=EC=A0=84 10=EC=8B=9C 14=EB=B6=84 49=EC=B4=88 UTC+9, Richard Smith =EB=
=8B=98=EC=9D=98 =EB=A7=90:
> That's not correct. "const int &rcr(0)" implicitly creates a temporary ob=
ject of type int and binds the reference to that object. (The reference bin=
ding then extends the lifetime of that temporary object to the lifetime of =
the reference.)
>  I'm speaking about what it means, not how it is implemented. Even if it =
is implemented as it refers to a temporary object, it should be treated as =
it doesn't refer to an object, I mean.

It=E2=80=99s part of the meaning of the program, not an arbitrary implement=
ation detail. Excerpt from my upcoming proposal, revising N4221:

> Lifetime extension is a very old C++ feature, originating before ISO stan=
dardization began. Initializing a const& reference variable from a function=
 result to avoid a copy has worked since references were introduced. =E2=80=
=A6Temporaries all worked that way at first =E2=80=A6 During the drafting o=
f the ARM (1988-1989), Stroustrup blessed the idea of early destruction of =
temporary objects. =E2=80=A6 Basic interoperability required some form of l=
ifetime extension rule.
>=20


--=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=_582A9A05-5F6D-4BCA-821D-D4FB888C917A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9308=
=E2=80=9322, at 9:21 AM, NDos Dannyu &lt;<a href=3D"mailto:ndospark320@nave=
r.com" class=3D"">ndospark320@naver.com</a>&gt; wrote:</div><div class=3D""=
><div dir=3D"ltr" class=3D""><br class=3D"">2015=EB=85=84 8=EC=9B=94 22=EC=
=9D=BC =ED=86=A0=EC=9A=94=EC=9D=BC =EC=98=A4=EC=A0=84 10=EC=8B=9C 14=EB=B6=
=84 49=EC=B4=88 UTC+9, Richard Smith =EB=8B=98=EC=9D=98 =EB=A7=90:<br class=
=3D""><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex;=
 padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-widt=
h: 1px; border-left-style: solid;"><div dir=3D"ltr" class=3D""><div class=
=3D""><div class=3D"gmail_quote"><div class=3D"">That's not correct. "const=
 int &amp;rcr(0)" implicitly creates a temporary object of type int and bin=
ds the reference to that object. (The reference binding then extends the li=
fetime of that temporary object to the lifetime of the reference.)<br class=
=3D""></div></div></div></div></blockquote><div class=3D"">&nbsp;I'm speaki=
ng about what it means, not how it is implemented. Even if it is implemente=
d as it refers to a temporary object, it should be treated as it doesn't re=
fer to an object, I mean.</div></div></div></blockquote><br class=3D""></di=
v><div>It=E2=80=99s part of the meaning of the program, not an arbitrary im=
plementation detail. Excerpt from my upcoming proposal, revising N4221:</di=
v><div><br class=3D""></div><div><blockquote type=3D"cite" class=3D""><p st=
yle=3D"margin: 0px 0px 6px; -webkit-text-stroke-color: rgb(0, 0, 0); -webki=
t-text-stroke-width: initial;" class=3D"">Lifetime extension is a very old =
C++ feature, originating before ISO standardization began. Initializing a <=
span style=3D"font-size: 11px; font-family: Courier; background-color: rgb(=
245, 245, 245);" class=3D"">const&amp;</span> reference variable from a fun=
ction result to avoid a copy has worked since references were introduced. =
=E2=80=A6<span style=3D"-webkit-text-stroke-width: initial;" class=3D"">Tem=
poraries all worked that way at first&nbsp;</span><span style=3D"-webkit-te=
xt-stroke-width: initial;" class=3D"">=E2=80=A6&nbsp;</span><span style=3D"=
-webkit-text-stroke-width: initial;" class=3D"">During the drafting of the =
ARM (1988-1989), Stroustrup blessed the idea of early destruction of tempor=
ary objects</span><span style=3D"-webkit-text-stroke-width: initial;" class=
=3D"">. =E2=80=A6 Basic interoperability required some form of lifetime ext=
ension rule.</span></p></blockquote></div><div class=3D""><br class=3D""></=
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=_582A9A05-5F6D-4BCA-821D-D4FB888C917A--

.
