220 9786 <CAOfiQqk_Fum4kOw2A+2VOuYHkWbRd7WrwEUMpqXnKx1f-DSCLw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Richard Smith <richard@metafoo.co.uk>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: pointer to member of class C of type
 reference to T
Date: Thu, 13 Mar 2014 14:39:15 -0700
Lines: 85
Approved: news@gmane.org
Message-ID: <CAOfiQqk_Fum4kOw2A+2VOuYHkWbRd7WrwEUMpqXnKx1f-DSCLw@mail.gmail.com>
References: <7b18f21a-cae0-4a26-89be-87f8aec094ad@isocpp.org>
	<251bafb5-8d28-44b1-8691-e69a4a767106@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7b3a946aee372f04f483c853
X-Trace: ger.gmane.org 1394746751 21399 80.91.229.3 (13 Mar 2014 21:39:11 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 13 Mar 2014 21:39:11 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDVNBJG4YAIBBBGLRCMQKGQEFYBNF2I@isocpp.org Thu Mar 13 22:39:19 2014
Return-path: <std-proposals+bncBDVNBJG4YAIBBBGLRCMQKGQEFYBNF2I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yh0-f71.google.com ([209.85.213.71])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDVNBJG4YAIBBBGLRCMQKGQEFYBNF2I@isocpp.org>)
	id 1WODLS-0002DC-2p
	for gclcip-std-proposals@m.gmane.org; Thu, 13 Mar 2014 22:39:18 +0100
Original-Received: by mail-yh0-f71.google.com with SMTP id a41sf3844550yho.6
        for <gclcip-std-proposals@m.gmane.org>; Thu, 13 Mar 2014 14:39:17 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:sender:in-reply-to:references:date
         :message-id:subject:from: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=VSbPtaeiRj721NIB8jm3zCN/jBVYwhYplmHFtC5aklw=;
        b=aiFooNCYhIeN7VApE+9ZdNaI3u2GnW6UdPEOImQc38JVIKGDsMIR37Gnomf96QyoPi
         KeaoA3aQyXnmbHKSbnx7z1Ev9COzyPKJ7e5s302eT07SQVzPNgE+AFkfmqRPLKePR2lR
         WTG/WeSUBFGikGMsmnGDsk/FTdkBKnk49PcpKITLjGVPSvEhNYoojD1tBZ8CN7GHsOa+
         DZVTDdoRcuVAjbTwRj8e1dXaXOXrXrozZuANDDBIXJ3pFGDjVUbx+4YozaCFh6xHXFEC
         VHgvtngECAH5h2rTkEv9BXoqjh0dWrkofDyjnhhU0uJiehF7vIP7y8Oeub1P+BXKG8m9
         SRKw==
X-Gm-Message-State: ALoCoQlttyYtQXnFsZAJAViQlryZhN4sfsmqP2ZMm5LJ1jGXHLXIibbbIhWvyDz5PHLhL3V9yuk+
X-Received: by 10.58.112.1 with SMTP id im1mr1508065veb.33.1394746756979;
        Thu, 13 Mar 2014 14:39:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.94.41 with SMTP id f38ls458019qge.55.gmail; Thu, 13 Mar
 2014 14:39:16 -0700 (PDT)
X-Received: by 10.221.61.210 with SMTP id wx18mr3233546vcb.27.1394746756153;
        Thu, 13 Mar 2014 14:39:16 -0700 (PDT)
Original-Received: from mail-ve0-x22b.google.com (mail-ve0-x22b.google.com [2607:f8b0:400c:c01::22b])
        by mx.google.com with ESMTPS id u5si1330725vdo.56.2014.03.13.14.39.15
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Thu, 13 Mar 2014 14:39:16 -0700 (PDT)
Received-SPF: pass (google.com: domain of metafoo@gmail.com designates 2607:f8b0:400c:c01::22b as permitted sender) client-ip=2607:f8b0:400c:c01::22b;
Original-Received: by mail-ve0-f171.google.com with SMTP id cz12so1814831veb.30
        for <std-proposals@isocpp.org>; Thu, 13 Mar 2014 14:39:15 -0700 (PDT)
X-Received: by 10.220.164.80 with SMTP id d16mr3162944vcy.15.1394746755788;
 Thu, 13 Mar 2014 14:39:15 -0700 (PDT)
Original-Sender: metafoo@gmail.com
Original-Received: by 10.58.218.131 with HTTP; Thu, 13 Mar 2014 14:39:15 -0700 (PDT)
In-Reply-To: <251bafb5-8d28-44b1-8691-e69a4a767106@isocpp.org>
X-Original-Sender: richard@metafoo.co.uk
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of metafoo@gmail.com designates 2607:f8b0:400c:c01::22b as permitted
 sender) smtp.mail=metafoo@gmail.com;       dkim=pass header.i=@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:9786
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/9786>

--047d7b3a946aee372f04f483c853
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Mar 13, 2014 at 2:17 PM, Cleiton Santoia
<cleitonsantoia@gmail.com>wrote:

> We got the same problem on N3951 as Tiago Macieira pointed and remains the
> doubt why "int& X::*" not allowed ? I think i should have a const
> somewhere, since you cannot reassign the refererence. But other than that
> references are pointer in disguise.
>

No, they aren't (no matter how any particular implementation chooses to
represent them). A reference isn't required to occupy storage or have an
address (see 8.3.2/4). For instance, given:

  int n;
  struct X {
    X() {}
    int &r = n;
  };

.... an implementation could choose to not allocate any storage for the 'r'
member in X, and instead rewrite all uses of it to directly reference ::n.

That said, as far as I'm aware no implementation does anything remotely
like this for class members of reference type, and in practice this
extension seems feasible (even though it weakens the conceptual model for
references).

-- 

--- 
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/.

--047d7b3a946aee372f04f483c853
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
hu, Mar 13, 2014 at 2:17 PM, Cleiton Santoia <span dir=3D"ltr">&lt;<a href=
=3D"mailto:cleitonsantoia@gmail.com" target=3D"_blank">cleitonsantoia@gmail=
..com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>We got the same proble=
m on N3951 as Tiago Macieira pointed and remains the doubt why &quot;int&am=
p; X::*&quot; not allowed ? I think i should have a const somewhere, since =
you cannot reassign the refererence. But other than that references are poi=
nter in disguise.</div>
</div></blockquote><div><br></div><div>No, they aren&#39;t (no matter how a=
ny particular implementation chooses to represent them). A reference isn&#3=
9;t required to occupy storage or have an address (see 8.3.2/4). For instan=
ce, given:</div>
<div><br></div><div>=A0 int n;</div><div>=A0 struct X {</div><div>=A0 =A0 X=
() {}</div><div>=A0 =A0 int &amp;r =3D n;</div><div>=A0 };</div><div><br></=
div><div>... an implementation could choose to not allocate any storage for=
 the &#39;r&#39; member in X, and instead rewrite all uses of it to directl=
y reference ::n.</div>
<div><br></div><div>That said, as far as I&#39;m aware no implementation do=
es anything remotely like this for class members of reference type, and in =
practice this extension seems feasible (even though it weakens the conceptu=
al model for references).</div>
</div></div></div>

<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 />

--047d7b3a946aee372f04f483c853--

.
