220 32121 <23d75c32-3724-49fa-961a-cb4a2c7259b7@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Jakob Riedle <jakob.riedle@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Allow to access member typedefs of a type from a
 reference type that's referring to that type
Date: Thu, 20 Apr 2017 00:57:25 -0700 (PDT)
Lines: 94
Approved: news@gmane.org
Message-ID: <23d75c32-3724-49fa-961a-cb4a2c7259b7@isocpp.org>
References: <DM5PR2201MB151446C188D54CABB6E0FE9C87240@DM5PR2201MB1514.namprd22.prod.outlook.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1993_1787644953.1492675045360"
X-Trace: blaine.gmane.org 1492675048 1701 195.159.176.226 (20 Apr 2017 07:57:28 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 20 Apr 2017 07:57:28 +0000 (UTC)
Cc: walter.heisenbug@outlook.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCX2XNFO6MPRBZWT4HDQKGQEXUYJJ7A@isocpp.org Thu Apr 20 09:57:22 2017
Return-path: <std-proposals+bncBCX2XNFO6MPRBZWT4HDQKGQEXUYJJ7A@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f198.google.com ([209.85.216.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCX2XNFO6MPRBZWT4HDQKGQEXUYJJ7A@isocpp.org>)
	id 1d16xt-0000HQ-Fh
	for gclcip-std-proposals@m.gmane.org; Thu, 20 Apr 2017 09:57:21 +0200
Original-Received: by mail-qt0-f198.google.com with SMTP id m91sf12093016qte.10
        for <gclcip-std-proposals@m.gmane.org>; Thu, 20 Apr 2017 00:57:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=awwfSgBwT+Q/bGVFm8RKBpZtXdP5FP/ktJISpcng8yk=;
        b=Jf0ZVbqeiPJJZkPVdY3ffz2yYcocHgisapKD/IhNirXY1WJBRxQz5UB1Px87qVLIz0
         2yNWrgfFExX/haJlxppafChsHoAOtL5ihFCNAc81f+GuL39ggcLG2KZNavCoXcGajfhQ
         X3TGXnbOd6DJYQPOyw9GEEgTaSHx5+ni+cmERZL/elmATEFghCQ509XgGTUYrXEFcLPd
         FdPFbe4oH6J17VBr6Bzgsk1HnAillIW5DmQku8OWuJ8qB4ZB7rdtePJKPeT6p0wZEK2i
         koLsi9KHOr6bjG3Rjybh8VIV2HL6fol9ADiYRcJP0Z/MctTxalYBT0+Sxg/HZPCdUPm9
         IUyw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=awwfSgBwT+Q/bGVFm8RKBpZtXdP5FP/ktJISpcng8yk=;
        b=M3Znfm6CSjB8FIYGBcAV+vfEvtTSJbcjjd0xGMJXx5miLPKqHsTcYjR/Pf6GGcRcHd
         KHojGDZSFztzREWhkTXapyIoj5TNYQmRRcf3XIERzjxyrt2F6SaSCz1JIg61vEWgHJ/j
         yj7wH3WVRE2/Nr4cWiMqNoCOJ6qzIXyDbYa5QvZ+grWhjmvms6mLWNh1sh+pFjf8v0Sp
         brYsVOVgq5pS+qPs5yqTzeaoHQ6cg+841sPAS39J0Klf0VYjtGFTN6Dy9Dpzg0GJ719a
         sd7h1JujXUbWDfKoB9Ksw7nR5x0XjKsmNG1/QWBcqcz6rFdanxXcjVqDJbOJKt633RKs
         TNmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=awwfSgBwT+Q/bGVFm8RKBpZtXdP5FP/ktJISpcng8yk=;
        b=tyTAMS14zblT0JuDwvlWath+MnVQhMzj9nSXVJPQnLk4li/PpcwydlzCL2YNg5d79X
         YYr68k1Y/E2quDZOsbh9o4c5HwjU9Zz2JQ0YD4/luClqvzqD71nzTICeroTNC2gpNIDa
         ZaFhQqWlwSHTCOLRPaa6PTb+GfCuYRd6ofgcu9pFgfEoExzsfZVdegnAm0Hf7xjgXJsx
         bIBS39h7wbEaiyLLTihQgGkDaFum/e/AavN+FKMT+C9KjMrj6wTbaodLoHSZ6XOpx44u
         UvWagqDy8JjgSjsMh73TMiomrme1Fee/Cv9KbyiUyHzGszO7TSdD4kdXQiL78pIehWHS
         AsYw==
X-Gm-Message-State: AN3rC/4n7OIJoPzeh69gFvhRzQ2Yyss3pdsl68QtsinlxV9TIOj+qzsc
	f/0nV/AJzj42xg==
X-Received: by 10.237.35.8 with SMTP id h8mr2945360qtc.67.1492675047007;
        Thu, 20 Apr 2017 00:57:27 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.4.119 with SMTP id 110ls1414928otc.41.gmail; Thu, 20 Apr
 2017 00:57:25 -0700 (PDT)
X-Received: by 10.157.80.163 with SMTP id b35mr69656oth.16.1492675045859;
        Thu, 20 Apr 2017 00:57:25 -0700 (PDT)
In-Reply-To: <DM5PR2201MB151446C188D54CABB6E0FE9C87240@DM5PR2201MB1514.namprd22.prod.outlook.com>
X-Original-Sender: jakob.riedle@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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:32121
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32121>

------=_Part_1993_1787644953.1492675045360
Content-Type: multipart/alternative; 
	boundary="----=_Part_1994_1935460801.1492675045360"

------=_Part_1994_1935460801.1492675045360
Content-Type: text/plain; charset=UTF-8

I quite like this idea and I had this problem myself. The reason why 
compilers reject this code is because
'T is not a class, struct, or union type'. I don't know whether it is a 
good idea to consider *reference to class *a *class type.*
It would be very misleading to do this if we allow references to class 
types to be usable as if they were the referenced class:
struct A{};
struct B : A& {};

*References to objects* can be and are treated exactly like the referenced 
object itself.
Note that this only concerns the *run-time*.
On the other hand a *reference type* is not a class, it is ... a reference.

IMHO it is very consequent, that e.g. T::r is not resolvable for T being a 
reference type,
because its not a class, struct or union type.

Cheers
Jakob

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/23d75c32-3724-49fa-961a-cb4a2c7259b7%40isocpp.org.

------=_Part_1994_1935460801.1492675045360
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I quite like this idea and I had this problem myself. The =
reason why compilers reject this code is because<div>&#39;<span style=3D"ba=
ckground-color: rgb(245, 245, 245); color: rgb(51, 51, 51); font-family: Me=
nlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; font-size: 13.33=
33px; white-space: pre;">T is not a class, struct, or union type&#39;</span=
>. I don&#39;t know whether it is a good idea to consider <i>reference to c=
lass </i>a <i>class type.</i></div><div>It would be very misleading to do t=
his if we allow references to class types to be usable as if they were the =
referenced class:</div><div class=3D"prettyprint" style=3D"background-color=
: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid=
; border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><d=
iv class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by=
-prettify">struct</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> A</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{=
};</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">struct</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> B </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> A</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&amp;</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">{};</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br></span></div></code></div><div><br></div><div><b>References=
 to objects</b> can be and are treated exactly like the referenced object i=
tself.</div><div>Note that this only concerns the <b>run-time</b>.</div><di=
v>On the other hand a <i>reference type</i> is not a class, it is ... a ref=
erence.</div><div><br></div><div>IMHO it is very consequent, that e.g. <spa=
n style=3D"background-color: rgb(245, 245, 245); color: rgb(51, 51, 51); fo=
nt-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, monospace; fon=
t-size: 13.3333px; white-space: pre;">T::r</span>=C2=A0is not resolvable fo=
r=C2=A0<span style=3D"background-color: rgb(245, 245, 245); color: rgb(51, =
51, 51); font-family: Menlo, Monaco, Consolas, &quot;Courier New&quot;, mon=
ospace; font-size: 13.3333px; white-space: pre;">T</span>=C2=A0being a refe=
rence type,</div><div>because its not a class, struct or union type.</div><=
div><br></div><div>Cheers</div><div>Jakob</div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/23d75c32-3724-49fa-961a-cb4a2c7259b7%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/23d75c32-3724-49fa-961a-cb4a2c7259b7=
%40isocpp.org</a>.<br />

------=_Part_1994_1935460801.1492675045360--

------=_Part_1993_1787644953.1492675045360--

.
