220 19955 <3183929.eXnTES4BH3@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Address of a reference: determining the value
 category of what it refers?
Date: Fri, 21 Aug 2015 19:24:47 -0700
Lines: 56
Approved: news@gmane.org
Message-ID: <3183929.eXnTES4BH3@tjmaciei-mobl4>
References: <76fe342f-3342-4355-af20-1c41b21e54aa@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
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1440210307 29544 80.91.229.3 (22 Aug 2015 02:25:07 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 22 Aug 2015 02:25:07 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRB5V236XAKGQEXDDSS7A@isocpp.org Sat Aug 22 04:24:56 2015
Return-path: <std-proposals+bncBCB4TK757YBRB5V236XAKGQEXDDSS7A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f199.google.com ([209.85.217.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRB5V236XAKGQEXDDSS7A@isocpp.org>)
	id 1ZSyUK-0000Ur-3W
	for gclcip-std-proposals@m.gmane.org; Sat, 22 Aug 2015 04:24:56 +0200
Original-Received: by lbcue2 with SMTP id ue2sf25098965lbc.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 21 Aug 2015 19:24:55 -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:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:content-transfer-encoding
         :content-type: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=hhBSHD8S79llOJ7zdJPO6eZBDLiws/fQ483jwO318Xg=;
        b=DG9T+L2zn/HlsgknKf2vLb4JvpFSM43pQIH270AzSlJvcl/FbEEqeuip77N96vJF8i
         QcZx35L92EOX8N3VXwtw3iGewl1lDkPHbO/lc1v8NpuolKPXuwacpnmgvd7OQNHieuRM
         BnTsvr2eTFx1zNuDwEk0CDzYbDKwMEiMhl89/esxdFBIkM9GcuK5q8GX8Fgk4knnZMco
         bJZ3mal7c7/OSrN/UDRo5RIbEUTPwQW3Q3VxcpW4LGfUaoP+8mv74V5/RVbSiI9uKc6E
         uesbOZw45mQi70DMuppJz0/7uqVHEasZ4xVsOdUvLHbTnpwIPOPWxWes8 
X-Gm-Message-State: ALoCoQndv8HGFUXwUTPhiWY4kZBjoQ324L7429fAL5mB8ft5fJCOCAkSGPT/Swjmg1DXeD0GIBtb
X-Received: by 10.112.140.195 with SMTP id ri3mr866820lbb.22.1440210295079;
        Fri, 21 Aug 2015 19:24:55 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.89.9 with SMTP id bk9ls444746wib.43.gmail; Fri, 21 Aug
 2015 19:24:53 -0700 (PDT)
X-Received: by 10.180.108.103 with SMTP id hj7mr11101651wib.11.1440210293614;
        Fri, 21 Aug 2015 19:24:53 -0700 (PDT)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [2a01:4f8:d13:f81:21c:14ff:fe01:12a3])
        by mx.google.com with ESMTP id bi4si2593547wib.2.2015.08.21.19.24.52
        for <std-proposals@isocpp.org>;
        Fri, 21 Aug 2015 19:24:52 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3 as permitted sender) client-ip=2a01:4f8:d13:f81:21c:14ff:fe01:12a3;
Original-Received: from tjmaciei-mobl4.localnet (unknown [IPv6:2601:1c0:5803:81c9:40d2:14bc:2276:38b6])
	by gondolin.macieira.info (Postfix) with ESMTPSA id D272C11A778
	for <std-proposals@isocpp.org>; Fri, 21 Aug 2015 19:24:50 -0700 (PDT)
User-Agent: KMail/4.14.9 (Linux/4.1.3-1-desktop; KDE/4.14.9; x86_64; ; )
In-Reply-To: <d48969a2-f27a-4c82-869e-6a848c9f1422@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2a01:4f8:d13:f81:21c:14ff:fe01:12a3
 as permitted sender) smtp.mailfrom=thiago@macieira.org
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:19955
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19955>

On Friday 21 August 2015 18:21:57 NDos Dannyu wrote:
> 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
> > object of type int and binds the reference to that object. (The referen=
ce
> > binding then extends the lifetime of that temporary object to the lifet=
ime
> > of the reference.)
>=20
>  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 i=
t
> doesn't refer to an object, I mean.

It means what Richard said: it refers to an object which has an address. Th=
e=20
fact that it is temporary isn't relevant.

And changing this now isn't a good idea. Not to mention that it can't be=20
implemented. Take, for example:

int *doit(const int &ref)
{
	printf("%d\n", ref);
	return &ref;
}

You're saying that the function doit above should return null if it was cal=
led=20
with a reference to a temporary. But if it does so, how will it print the=
=20
value that was referenced?

Besides, we're missing an important aspect: why do you want this? What's th=
e=20
motivation?
--=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

--=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/.

.
