220 26355 <74885fa3-1a38-4394-b017-9a102001f199@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: "T. C." <rs2740@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Float the idea:  Forward declaring inner classes
Date: Mon, 20 Jun 2016 17:42:18 -0700 (PDT)
Lines: 205
Approved: news@gmane.org
Message-ID: <74885fa3-1a38-4394-b017-9a102001f199@isocpp.org>
References: <299109ab-04d2-462f-8f50-ce31206e96b3@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1457_1346568539.1466469738269"
X-Trace: ger.gmane.org 1466469776 27079 80.91.229.3 (21 Jun 2016 00:42:56 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 21 Jun 2016 00:42:56 +0000 (UTC)
Cc: xaxxon@gmail.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCQ43G7NQIIRB242UK5QKGQENMCJOWA@isocpp.org Tue Jun 21 02:42:43 2016
Return-path: <std-proposals+bncBCQ43G7NQIIRB242UK5QKGQENMCJOWA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f199.google.com ([209.85.220.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCQ43G7NQIIRB242UK5QKGQENMCJOWA@isocpp.org>)
	id 1bF9ll-0002zN-As
	for gclcip-std-proposals@m.gmane.org; Tue, 21 Jun 2016 02:42:21 +0200
Original-Received: by mail-qk0-f199.google.com with SMTP id z142sf2694111qkb.0
        for <gclcip-std-proposals@m.gmane.org>; Mon, 20 Jun 2016 17:42:21 -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=b6YPAXo5NDDQ2POJuIXZ1xD1wZkj6l7js4setUCobG0=;
        b=LUl5NH0DmI2IS9pavuqiUZBsfsGy7UQ9vUqXbNtJo7R6OZj4fVwHxit+xDdswomLuH
         0vpgxj+HHJYsDaMlZ0XzgofurJuvg9L38MVqmhbXTLQ0zN23ewfQtfjwH+dBR2K9RMIL
         xcWKvR34wj/VPeRMkosUuLHEz5T6jqyVgQoSjxBRAQJpX+iGCV7j2IWl0a5fNrSyeZ98
         A+uf2tn3BLOjTYjN4io5sFn/RJeg3aW4075y8nCtARJhlJwFbUc5fBEj6ERr/6r1GH7B
         PooPRw5/OwaxzcH+QmoIrbCMvAogxWROZS9s7QNCm2pW5VSy8cszQUQWW2PQgJNXwVOb
         D+/Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        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=b6YPAXo5NDDQ2POJuIXZ1xD1wZkj6l7js4setUCobG0=;
        b=ZRwmdiFDmWZhiM32NPGdu/pY6HkjAYtoZp76kBiEyXcHOmHMKrwUsWbQQNZtulEuG3
         CMN7Mh/lXGBkZRRh5LVujZXAldh3uWbegVvEl/uk1XBwO74aooM+aC5kk92CvxZnOGqG
         R6lX9tNrHtMGOkWKk58hAJokk6XneoXNvRutaTy2IzLOXnzw9RBSEJVntGfnMMgK2Pg4
         i1VkRj3Dl9E+AYGxiqdDjCuLvN7dlCs2sNo24TMzkNV16IXDaCqWHPm642eeAniK8ZvP
         giFI8B8FTDAGutqbB+bWwt6C3zd0yiORHWKjCJJXBM4oqcvxgcYXv2KmJcDzaKUIycb6
         PGzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        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=b6YPAXo5NDDQ2POJuIXZ1xD1wZkj6l7js4setUCobG0=;
        b=dw5OKZZ+IsBYBrwRyGbs5nIjrATOODj/+gYk2Kc4nEMve9A1aUy/aMn8baRwHCkfWp
         5HE9sOZLfjF2fedY3RLKbglGO8F9JsCTE7DBVL0WcN5qZNDYW7hGieuJ2ys/kETfBvSi
         Y3NKjQp1/jQo2MtP/tp7nr4HVowFJfZ4HLLIz9btjIK330nftigiAjiAbAOobj9fTN4B
         nto8KQIG+9uLjLglhVu4wPX4at3W9AWNRhMr9/cU1Uxig0EdEciApNBtUYmn5XO8knsA
         KwWeOjDil+XnEzIGfKMvzm7vUmd2hLo6qD508KUSUqklaPvjw+4udzhky7h8NPXofWui
         QgqQ==
X-Gm-Message-State: ALyK8tK4/RFrlBzVoy8X9Ff1Cq6H366h+iqsPaka3F0h2/s/4eWLZA0g3BayOyA4wAkx7g==
X-Received: by 10.129.159.208 with SMTP id w199mr23850546ywg.41.1466469740458;
        Mon, 20 Jun 2016 17:42:20 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.176.66 with SMTP id z63ls1737743ioe.64.gmail; Mon, 20 Jun
 2016 17:42:19 -0700 (PDT)
X-Received: by 10.36.1.15 with SMTP id 15mr15827itk.6.1466469739350;
        Mon, 20 Jun 2016 17:42:19 -0700 (PDT)
In-Reply-To: <299109ab-04d2-462f-8f50-ce31206e96b3@isocpp.org>
X-Original-Sender: rs2740@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: <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:26355
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26355>

------=_Part_1457_1346568539.1466469738269
Content-Type: multipart/alternative; 
	boundary="----=_Part_1458_241192018.1466469738270"

------=_Part_1458_241192018.1466469738270
Content-Type: text/plain; charset=UTF-8

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0289r0.pdf

On Monday, June 20, 2016 at 7:35:29 PM UTC-4, xax...@gmail.com wrote:
>
> I've never written anything to this list before and am trying to follow 
> the instructions here: https://isocpp.org/std/submit-a-proposal
>
> I'd like to allow forward declarations of inner classes.  Here is a 
> situation I've run into where it seems that forward declaring the inner 
> classes would allow this to work:
>
>
> class Outer1; // <== potentially optional
> class Outer::Inner; //<== NEW
>
>
> class Outer2; // <== potentially optional
> class Outer2::Inner; //<== NEW
>
>
> template<class T>
> class SomeClass {
>
> // !!error: no type named 'Inner' in 'Outer1' <== clang error in current 
> c++
>   typename T::Inner * some_func();
> };
>
>
> class Outer1 : public SomeClass<Outer1> { 
>   public:
>   class Inner {
>   };
> };
>
>
> class Outer2 : public SomeClass<Outer2> {
>   public:
>   class Inner {
>   };
> };
>
>
> While there are certainly workarounds, I find this organizational 
> structure to be useful in other languages and would have used it in c++ had 
> it been available.   
>
> Live code: https://godbolt.org/g/A5jd87
>
> The workaround I've found is this, but the code doesn't match my intent 
> nearly as well.  
> class Outer1Inner {};
> class Outer1 : public SomeClass<Outer1Inner> {};
>
>
>
> Thank you for your feedback - either on the actual proposal or on proposal 
> procedure.
>
> --Zac
>

-- 
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/74885fa3-1a38-4394-b017-9a102001f199%40isocpp.org.

------=_Part_1458_241192018.1466469738270
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0=
289r0.pdf<br><br>On Monday, June 20, 2016 at 7:35:29 PM UTC-4, xax...@gmail=
..com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left=
: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><d=
iv>I&#39;ve never written anything to this list before and am trying to fol=
low the instructions here:=C2=A0<a href=3D"https://isocpp.org/std/submit-a-=
proposal" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#3=
9;https://www.google.com/url?q\x3dhttps%3A%2F%2Fisocpp.org%2Fstd%2Fsubmit-a=
-proposal\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGlLyCIYYQUZNTTJdUEpCYxvwG=
8Ig&#39;;return true;" onclick=3D"this.href=3D&#39;https://www.google.com/u=
rl?q\x3dhttps%3A%2F%2Fisocpp.org%2Fstd%2Fsubmit-a-proposal\x26sa\x3dD\x26sn=
tz\x3d1\x26usg\x3dAFQjCNGlLyCIYYQUZNTTJdUEpCYxvwG8Ig&#39;;return true;">htt=
ps://isocpp.org/std/<wbr>submit-a-proposal</a><br></div><div><br></div><div=
>I&#39;d like to allow forward declarations of inner classes. =C2=A0Here is=
 a situation I&#39;ve run into where it seems that forward declaring the in=
ner classes would allow this to work:</div><div style=3D"border:1px solid r=
gb(187,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"><co=
de><div><span style=3D"color:#000"><br><br></span><span style=3D"color:#008=
">class</span><span style=3D"color:#000"> </span><span style=3D"color:#606"=
>Outer1</span><span style=3D"color:#660">;</span><span style=3D"color:#000"=
> </span><span style=3D"color:#800">// &lt;=3D=3D potentially optional</spa=
n><span style=3D"color:#000"><br></span><span style=3D"color:#008">class</s=
pan><span style=3D"color:#000"> </span><span style=3D"color:#606">Outer</sp=
an><span style=3D"color:#660">::</span><span style=3D"color:#606">Inner</sp=
an><span style=3D"color:#660">;</span><span style=3D"color:#000"> </span><s=
pan style=3D"color:#800">//&lt;=3D=3D NEW</span><span style=3D"color:#000">=
<br><br><br></span><span style=3D"color:#008">class</span><span style=3D"co=
lor:#000"> </span><span style=3D"color:#606">Outer2</span><span style=3D"co=
lor:#660">;</span><span style=3D"color:#000"> </span><span style=3D"color:#=
800">// &lt;=3D=3D potentially optional</span><span style=3D"color:#000"><b=
r></span><span style=3D"color:#008">class</span><span style=3D"color:#000">=
 </span><span style=3D"color:#606">Outer2</span><span style=3D"color:#660">=
::</span><span style=3D"color:#606">Inner</span><span style=3D"color:#660">=
;</span><span style=3D"color:#000"> </span><span style=3D"color:#800">//&lt=
;=3D=3D NEW</span><span style=3D"color:#000"><br><br><br></span><span style=
=3D"color:#008">template</span><span style=3D"color:#660">&lt;</span><span =
style=3D"color:#008">class</span><span style=3D"color:#000"> T</span><span =
style=3D"color:#660">&gt;</span><span style=3D"color:#000"><br></span><span=
 style=3D"color:#008">class</span><span style=3D"color:#000"> </span><span =
style=3D"color:#606">SomeClass</span><span style=3D"color:#000"> </span><sp=
an style=3D"color:#660">{</span><span style=3D"color:#000"><br></span><span=
 style=3D"color:#000"><br></span><span style=3D"color:#800">// !!error: no =
type named &#39;Inner&#39; in &#39;Outer1&#39; &lt;=3D=3D clang error in cu=
rrent c++</span><span style=3D"color:#000"><br>=C2=A0 </span><span style=3D=
"color:#008">typename</span><span style=3D"color:#000"> T</span><span style=
=3D"color:#660">::</span><span style=3D"color:#606">Inner</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">*</span><span style=3D"c=
olor:#000"> some_func</span><span style=3D"color:#660">();</span><span styl=
e=3D"color:#000"><br></span><span style=3D"color:#660">};</span><span style=
=3D"color:#000"><br><br><br></span><span style=3D"color:#008">class</span><=
span style=3D"color:#000"> </span><span style=3D"color:#606">Outer1</span><=
span style=3D"color:#000"> </span><span style=3D"color:#660">:</span><span =
style=3D"color:#000"> </span><span style=3D"color:#008">public</span><span =
style=3D"color:#000"> </span><span style=3D"color:#606">SomeClass</span><sp=
an style=3D"color:#660">&lt;</span><span style=3D"color:#606">Outer1</span>=
<span style=3D"color:#660">&gt;</span><span style=3D"color:#000"> </span><s=
pan style=3D"color:#660">{</span><span style=3D"color:#000"> <br>=C2=A0 </s=
pan><span style=3D"color:#008">public</span><span style=3D"color:#660">:</s=
pan><span style=3D"color:#000"><br>=C2=A0 </span><span style=3D"color:#008"=
>class</span><span style=3D"color:#000"> </span><span style=3D"color:#606">=
Inner</span><span style=3D"color:#000"> </span><span style=3D"color:#660">{=
</span><span style=3D"color:#000"><br>=C2=A0 </span><span style=3D"color:#6=
60">};</span><span style=3D"color:#000"><br></span><span style=3D"color:#66=
0">};</span><span style=3D"color:#000"><br><br><br></span><span style=3D"co=
lor:#008">class</span><span style=3D"color:#000"> </span><span style=3D"col=
or:#606">Outer2</span><span style=3D"color:#000"> </span><span style=3D"col=
or:#660">:</span><span style=3D"color:#000"> </span><span style=3D"color:#0=
08">public</span><span style=3D"color:#000"> </span><span style=3D"color:#6=
06">SomeClass</span><span style=3D"color:#660">&lt;</span><span style=3D"co=
lor:#606">Outer2</span><span style=3D"color:#660">&gt;</span><span style=3D=
"color:#000"> </span><span style=3D"color:#660">{</span><span style=3D"colo=
r:#000"><br>=C2=A0 </span><span style=3D"color:#008">public</span><span sty=
le=3D"color:#660">:</span><span style=3D"color:#000"><br>=C2=A0 </span><spa=
n style=3D"color:#008">class</span><span style=3D"color:#000"> </span><span=
 style=3D"color:#606">Inner</span><span style=3D"color:#000"> </span><span =
style=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 </span><=
span style=3D"color:#660">};</span><span style=3D"color:#000"><br></span><s=
pan style=3D"color:#660">};</span></div></code></div><div><div><br></div></=
div><div><br></div><div>While there are certainly workarounds, I find this =
organizational structure to be useful in other languages and would have use=
d it in c++ had it been available. =C2=A0=C2=A0</div><div><br></div><div>Li=
ve code:=C2=A0<a href=3D"https://godbolt.org/g/A5jd87" target=3D"_blank" re=
l=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.google.com/url?q=
\x3dhttps%3A%2F%2Fgodbolt.org%2Fg%2FA5jd87\x26sa\x3dD\x26sntz\x3d1\x26usg\x=
3dAFQjCNGEnO07UvG6LV1toCE0Qsgvu0lQrw&#39;;return true;" onclick=3D"this.hre=
f=3D&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgodbolt.org%2Fg%2FA5=
jd87\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGEnO07UvG6LV1toCE0Qsgvu0lQrw&#=
39;;return true;">https://godbolt.org/g/<wbr>A5jd87</a></div><div><br></div=
><div>The workaround I&#39;ve found is this, but the code doesn&#39;t match=
 my intent nearly as well. =C2=A0</div><div style=3D"border:1px solid rgb(1=
87,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"><code><=
div><span style=3D"color:#008">class</span><span style=3D"color:#000"> </sp=
an><span style=3D"color:#606">Outer1Inner</span><span style=3D"color:#000">=
 </span><span style=3D"color:#660">{};</span><span style=3D"color:#000"><br=
></span><span style=3D"color:#008">class</span><span style=3D"color:#000"> =
</span><span style=3D"color:#606">Outer1</span><span style=3D"color:#000"> =
</span><span style=3D"color:#660">:</span><span style=3D"color:#000"> </spa=
n><span style=3D"color:#008">public</span><span style=3D"color:#000"> </spa=
n><span style=3D"color:#606">SomeClass</span><span style=3D"color:#660">&lt=
;</span><span style=3D"color:#606">Outer1Inner</span><span style=3D"color:#=
660">&gt;</span><span style=3D"color:#000"> </span><span style=3D"color:#66=
0">{};</span><span style=3D"color:#000"><br><br></span></div></code></div><=
div><br><br></div><div>Thank you for your feedback - either on the actual p=
roposal or on proposal procedure.</div><div><br></div><div>--Zac</div></div=
></blockquote></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/74885fa3-1a38-4394-b017-9a102001f199%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/74885fa3-1a38-4394-b017-9a102001f199=
%40isocpp.org</a>.<br />

------=_Part_1458_241192018.1466469738270--

------=_Part_1457_1346568539.1466469738269--

.
