220 38042 <75fb8736-b92a-480f-9a36-310b3e03b131@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Phil Bouchard <philippeb8@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Fornux C++ Superset - Forward Declarations of
 Nested Structures
Date: Wed, 2 May 2018 04:26:52 -0700 (PDT)
Lines: 140
Approved: news@gmane.org
Message-ID: <75fb8736-b92a-480f-9a36-310b3e03b131@isocpp.org>
References: <cab4cada-1abe-48b2-9a4b-d6c9f994b805@isocpp.org>
 <CAOfiQqnoN-_KQ-AOTsAMCMnJK_nge1c59K0xOFy+u0jQEtFnOw@mail.gmail.com>
 <34fa23ed-1fab-44d5-92ab-217067b68225@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_27889_582949377.1525260412394"
X-Trace: blaine.gmane.org 1525260287 12428 195.159.176.226 (2 May 2018 11:24:47 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 2 May 2018 11:24:47 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCAYTFXFZMBBB7OAU3LQKGQEVHPVI7I@isocpp.org Wed May 02 13:24:43 2018
Return-path: <std-proposals+bncBCAYTFXFZMBBB7OAU3LQKGQEVHPVI7I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f198.google.com ([209.85.217.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCAYTFXFZMBBB7OAU3LQKGQEVHPVI7I@isocpp.org>)
	id 1fDpsJ-00038G-08
	for gclcip-std-proposals@m.gmane.org; Wed, 02 May 2018 13:24:43 +0200
Original-Received: by mail-ua0-f198.google.com with SMTP id a5sf657423uaf.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 02 May 2018 04:26:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=ttggTFVBMb0sacTowY9coIM+eGaMHdeIIF5ZIkZcmtg=;
        b=DXQhXKtZ2KSLLBwOCGgBrQyO3woKzd8kRzJNHec6wIpj8WUWJ/Gr/20dD4/ars8rcO
         ykeXKZMGHw9pAeGDXTMxodQ/DqARdaMOvKjk1/HCB35yEMr/YNi/wih7Gj3C5sc43HsR
         OT9KAGFmbU9FLcAGH7VftIx2z0WadpoHQ8Hufnk6RYx8G7cCppS9SXTTHPLrxmwhbeFX
         bZx8yzuGzj0wXB11y12aOYjIIrFxhCf2PrLge6SJj8ifAqISxcM3mgcYGcZwqdCOE+Jz
         hIflk18vi2SCSc1Xz94Ypfj4YFwVg8eX3KT4utuiO3cdbR5waM9561HiIVrA34+c4C7X
         7VlA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=ttggTFVBMb0sacTowY9coIM+eGaMHdeIIF5ZIkZcmtg=;
        b=IlSEcJAq5WeZz/IsuUeOUu6RMsj3Lg0jrUIfgOAwiJsK+pvWY5agUtyuwNMaQ1pwdM
         w82/3sXyZ1wSEPuAytFVIOCy/En9xJDFeDCDNQqQPkNLLrxnQ4vP+qd6GQXRGumChGNx
         Js/Kwxo2+DkY/Tvza1JsCAQFR+CNBZJ6INJqUsDl2wd8v/c9+sDuGX48tsm6XI7SUPRb
         yoJtSY/xAJvcU1vWpNivbt4EjlOzQP/nAFS8vwclIpYxQ2CnCnRBvDas24kUly+Ghm4L
         ZLUa/rDyy5uT909+jGOwL0VTTdNylnKzairHUQggzrP0V8IMQyapnx//tHOk+wL388rt
         izyA==
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: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=ttggTFVBMb0sacTowY9coIM+eGaMHdeIIF5ZIkZcmtg=;
        b=CT5ZZG5jWB7k6+QPndWBuWO2icPJPt2CgugoT8E25o1Uc3lq2Fm9vGWRl3eOq1OW21
         c3+5HU7mZBSpY0xgqbM0ohhdCLlY/EQxGR7i56rxMSlVm5LQ//Ad+48eOvJCtLPdoFN1
         2K5LeJYl//pH0mh2QO2phd+tYPECuv/g3KxpVUbIGMOl0GlDsGBKZyIlz3IsIEv+E8ub
         8wh9OLMgVs3mkop+wYR6TSYncw2mLHVgRy7z0xrtRFLVrxmMwEmifCdF1SqKzqNBMNFI
         a6jo6cbWTi6zaLCRUykIRZlfk1x+u5oxhuo3WdniBJZqS5y2HRI2InjUNyF628CnPKy4
         8RQg==
X-Gm-Message-State: ALQs6tArqRBWEEWPG2Pk5Ij6pOrC5jHlmfdC2IA0bFGgRUkeG7uIdBo4
	MIE4KOKd+2Z+bnoRDCeVR/fc6A==
X-Google-Smtp-Source: AB8JxZpJQ4N3R39W5jkGjYQA7diAjXMLIsPOXGtYozM2+Ew/c80a0oNixSdx04rm48hR6IUhn+bfPA==
X-Received: by 10.176.72.106 with SMTP id c39mr3951518uad.54.1525260413944;
        Wed, 02 May 2018 04:26:53 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a1f:5cd2:: with SMTP id q201-v6ls8004118vkb.21.gmail; Wed,
 02 May 2018 04:26:53 -0700 (PDT)
X-Received: by 2002:a1f:2f8b:: with SMTP id v133-v6mr2829678vkv.10.1525260412875;
        Wed, 02 May 2018 04:26:52 -0700 (PDT)
In-Reply-To: <34fa23ed-1fab-44d5-92ab-217067b68225@isocpp.org>
X-Original-Sender: philippeb8@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:38042
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38042>

------=_Part_27889_582949377.1525260412394
Content-Type: multipart/alternative; 
	boundary="----=_Part_27890_1897469063.1525260412394"

------=_Part_27890_1897469063.1525260412394
Content-Type: text/plain; charset="UTF-8"



On Wednesday, May 2, 2018 at 6:58:06 AM UTC-4, Phil Bouchard wrote:
>
>
>
> On Wednesday, May 2, 2018 at 12:27:16 AM UTC-4, Richard Smith wrote:
>>
>> See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0289r0.pdf
>>
>> The paper received some support from evolution. Some felt that the right 
>> answer was to wait for Modules. As noted in the above paper there are some 
>> open questions as to how this would actually work if we went forward with 
>> it.
>>
>
> 1) I personally would consider the possibility of declaring pointers of 
> nested classes based on the forward declaration of the aforementioned 
> nested class at all times. Ex.:
>
> class X;
> struct X::A;
>
> X::A * p = nullptr; // fine
>
> 1.1)
> class X
> {
> }; // error caught here: missing class A
>
> 1.2)
> class X
> {
>     struct A;
> }; // error caught here: private member and already used as public
>

Unless we bring the notion of "partial declarations" and forward 
declarations of nested structures are made like this:

class X
{
    struct A;
    .... // ellipsis operator here
};

X::A * p = nullptr; // error

class X
{
    struct A;
    
    void foo()
    {
        X::A * p = nullptr; // fine
    }
};

This way that would solve the access scope problem cleanly.


Regards,
-Phil

-- 
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/75fb8736-b92a-480f-9a36-310b3e03b131%40isocpp.org.

------=_Part_27890_1897469063.1525260412394
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, May 2, 2018 at 6:58:06 AM UTC-4, Phi=
l Bouchard wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><br><br>On Wednesday, May 2, 2018 at 12:27:16 AM UTC-4, Richard Smith w=
rote:<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">See <a href=
=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0289r0.pdf" re=
l=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D&#39;http://www=
..google.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fd=
ocs%2Fpapers%2F2016%2Fp0289r0.pdf\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG=
qKyQh-vd7CE3Iii5tU442rLP0FQ&#39;;return true;" onclick=3D"this.href=3D&#39;=
http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%=
2Fwg21%2Fdocs%2Fpapers%2F2016%2Fp0289r0.pdf\x26sa\x3dD\x26sntz\x3d1\x26usg\=
x3dAFQjCNGqKyQh-vd7CE3Iii5tU442rLP0FQ&#39;;return true;">http://www.open-st=
d.org/jtc1/<wbr>sc22/wg21/docs/papers/2016/<wbr>p0289r0.pdf</a><br><div><br=
></div><div>The paper received some support from evolution. Some felt that =
the right answer was to wait for Modules. As noted in the above paper there=
 are some open questions as to how this would actually work if we went forw=
ard with it.</div></div></blockquote><div><br></div><div>1) I personally wo=
uld consider the possibility of declaring pointers of nested=C2=A0classes b=
ased on the forward declaration of the aforementioned nested class at all t=
imes. Ex.:</div><div><br></div><div>class X;</div><div>struct X::A;</div><d=
iv><br></div><div>X::A=C2=A0* p =3D nullptr; // fine</div><div><br></div><d=
iv>1.1)</div><div>class X</div><div>{</div><div>}; // error=C2=A0caught her=
e: missing class A</div><div><br></div><div>1.2)</div><div>class X</div><di=
v>{</div><div>=C2=A0 =C2=A0 struct A;</div><div>}; // error caught here: pr=
ivate member and already used as public</div></div></blockquote><div><br></=
div><div>Unless we bring the notion of &quot;partial declarations&quot; and=
 forward declarations of nested structures are made like this:</div><div><b=
r></div><div>class X</div><div>{</div><div>=C2=A0 =C2=A0 struct A;</div><di=
v>=C2=A0 =C2=A0 .... // ellipsis operator here</div><div>};</div><div><br><=
/div><div><div>X::A=C2=A0* p =3D nullptr; // error</div></div><div><br></di=
v><div><div>class X</div><div>{</div><div>=C2=A0 =C2=A0 struct A;</div><div=
>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 void foo()</div><div>=C2=A0 =
=C2=A0 {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 X::A=C2=A0* p =3D nullptr; /=
/ fine</div><div>=C2=A0 =C2=A0 }</div><div>};</div></div><div><br></div><di=
v>This way that would solve the access scope problem cleanly.</div><div><br=
></div><div><br></div><div>Regards,</div><div>-Phil</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/75fb8736-b92a-480f-9a36-310b3e03b131%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/75fb8736-b92a-480f-9a36-310b3e03b131=
%40isocpp.org</a>.<br />

------=_Part_27890_1897469063.1525260412394--

------=_Part_27889_582949377.1525260412394--

.
