220 38063 <228ebe66-fa3d-40e8-a42f-37de41834977@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Bengt Gustafsson <bengt.gustafsson@beamways.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Fornux C++ Superset - Forward Declarations of
 Nested Structures
Date: Fri, 11 May 2018 07:30:34 -0700 (PDT)
Lines: 152
Approved: news@gmane.org
Message-ID: <228ebe66-fa3d-40e8-a42f-37de41834977@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>
 <75fb8736-b92a-480f-9a36-310b3e03b131@isocpp.org>
 <pd2ivq$saf$1@blaine.gmane.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_10214_285001668.1526049034592"
X-Trace: blaine.gmane.org 1526048910 10775 195.159.176.226 (11 May 2018 14:28:30 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Fri, 11 May 2018 14:28:30 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCRIRSPDTQIRBDGS23LQKGQEL53WI6I@isocpp.org Fri May 11 16:28:26 2018
Return-path: <std-proposals+bncBCRIRSPDTQIRBDGS23LQKGQEL53WI6I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f72.google.com ([209.85.213.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCRIRSPDTQIRBDGS23LQKGQEL53WI6I@isocpp.org>)
	id 1fH922-0002jB-Cj
	for gclcip-std-proposals@m.gmane.org; Fri, 11 May 2018 16:28:26 +0200
Original-Received: by mail-vk0-f72.google.com with SMTP id b136-v6sf4123406vke.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 11 May 2018 07:30:37 -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=sK2x+JHcraJPvEzsLhzfMgBWeWRkVfZAkvI5Y4YNOv0=;
        b=RHmfn7erc4YDXSzShjdU0hJw6u6e5eUNUtIR3ji1CkpUO71F0pWrClYPIUcPlS/yA4
         hDnSnw5e/g5xvMe0V3AO02v45tqTYbkKyjdD9WDODW8Ax6VtZ84GYMSwD/nqAORNFnWc
         Na8FRWiQ6cP90ZipbO2svuhTtIRnFDj+PcTx2o/JoqqFoJRZQgoqJUKiTNXJDJwjoFJ9
         53T3q/MuhvVWDqj1OC9FgPH7nl9cs8xcfDxR7Dxe5zh7EXlp+1Jan+8ZQzUXFa5hjbS6
         0vKmV9WSLZNum43RiliBNxVGvB/rbW95ckzF3lUmC3HDXMme0Wv86lBK0GCWz4fR7bcX
         yWaA==
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=sK2x+JHcraJPvEzsLhzfMgBWeWRkVfZAkvI5Y4YNOv0=;
        b=YvcM+AzJ0M9ICgSz4ynkVW37L0/ZEZ0elIpXwB1famPNOi1/CEKpGj/EyVOrc66Hll
         1xaisFkQk1KQ6IlBHyKl6nhhRq6PRgAKWrZ73uLHkV8ksfXUKXc7Mmj9kMP8h9iT/2B3
         c67zjXj5ay7e418k0/Hh09r/rm20kPtjFkK9ZWSGYOb3jnjwc1tUKyl9SMr9xbUv4L1B
         63ymtso3WDgfoy5qHGdV2k7kC8C3p30+GmRsE7la9P6lISqMkdb8M1baI4j+kKwhOBxP
         r5oLSxoC9FIYCqic+ibvmUmE+Ci1YUC5FoYRxbaSTuWW2H/Sif7q5JEeEVllM6dDraRL
         aURg==
X-Gm-Message-State: ALKqPwfeJvp8FwJxJTHvpAbB2eMYQgol08UqztMsE2h2Ic+w82XX6p0r
	T7V6c8otuxH++HrHA5Id5ncjuA==
X-Google-Smtp-Source: AB8JxZrxaIDn+xGZiBOldCg5g1CZkzES8uS5Nl8RtQ55eJ6OeY8nDgf24Ye68LSrykAA14snMIdPGw==
X-Received: by 2002:a1f:1505:: with SMTP id 5-v6mr1029631vkv.51.1526049037341;
        Fri, 11 May 2018 07:30:37 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a1f:ab4f:: with SMTP id u76-v6ls274431vke.2.gmail; Fri, 11
 May 2018 07:30:36 -0700 (PDT)
X-Received: by 2002:a1f:3686:: with SMTP id d128-v6mr244585vka.7.1526049035351;
        Fri, 11 May 2018 07:30:35 -0700 (PDT)
In-Reply-To: <pd2ivq$saf$1@blaine.gmane.org>
X-Original-Sender: bengt.gustafsson@beamways.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:38063
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38063>

------=_Part_10214_285001668.1526049034592
Content-Type: multipart/alternative; 
	boundary="----=_Part_10215_1712949569.1526049034593"

------=_Part_10215_1712949569.1526049034593
Content-Type: text/plain; charset="UTF-8"

I'm skeptical to partial declarations as the rules would be quite 
complicated. What I have found lacking on various occasions is the ability 
to declare inheritance in a forward declaration. Being able to declare 
inheritance relations early reduces the need of moving method 
implementations of methods out of the class head in certain situations.

When it comes to friend declarations it seems that you would not be helped 
by including them in a forward declaration as their sole purpose is to 
allow access to private members _which have not been declared yet_.

I would favor a proposal which includes your initial possibility to declare 
a nested class after declaring the outer class (or for consistence with 
namespace A::B { ... } without having to do so) plus the possibility to 
declare inheritance in a forward declaration.


Den fredag 11 maj 2018 kl. 01:03:36 UTC+2 skrev Phil Bouchard:
>
> On 05/02/2018 07:26 AM, Phil Bouchard wrote: 
> > 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. 
>
> Do we all agree this is a good solution? This could provide friend 
> declarations as well: 
>
> class X 
> { 
>       friend struct A; 
>
>       struct A; 
>       .... // ellipsis operator here 
> }; 
>
>
> 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/228ebe66-fa3d-40e8-a42f-37de41834977%40isocpp.org.

------=_Part_10215_1712949569.1526049034593
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I&#39;m skeptical to partial declarations as the rules wou=
ld be quite complicated. What I have found lacking on various occasions is =
the ability to declare inheritance in a forward declaration. Being able to =
declare inheritance relations early reduces the need of moving method imple=
mentations of methods out of the class head in certain situations.<div><br>=
</div><div>When it comes to friend declarations it seems that you would not=
 be helped by including them in a forward declaration as their sole purpose=
 is to allow access to private members _which have not been declared yet_.<=
/div><div><br></div><div>I would favor a proposal which includes your initi=
al possibility to declare a nested class after declaring the outer class (o=
r for consistence with namespace A::B { ... } without having to do so) plus=
 the possibility to declare inheritance in a forward declaration.</div><div=
><br><br>Den fredag 11 maj 2018 kl. 01:03:36 UTC+2 skrev Phil Bouchard:<blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;">On 05/02/2018 07:26 AM, Phil Bouch=
ard wrote:
<br>&gt; Unless we bring the notion of &quot;partial declarations&quot; and=
 forward=20
<br>&gt; declarations of nested structures are made like this:
<br>&gt;=20
<br>&gt; class X
<br>&gt; {
<br>&gt; =C2=A0=C2=A0 =C2=A0 struct A;
<br>&gt; =C2=A0=C2=A0 =C2=A0 .... // ellipsis operator here
<br>&gt; };
<br>&gt;=20
<br>&gt; X::A=C2=A0* p =3D nullptr; // error
<br>&gt;=20
<br>&gt; class X
<br>&gt; {
<br>&gt; =C2=A0=C2=A0 =C2=A0 struct A;
<br>&gt; =C2=A0=C2=A0 =C2=A0 void foo()
<br>&gt; =C2=A0=C2=A0 =C2=A0 {
<br>&gt; =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 X::A=C2=A0* p =3D nullptr; // fi=
ne
<br>&gt; =C2=A0=C2=A0 =C2=A0 }
<br>&gt; };
<br>&gt;=20
<br>&gt; This way that would solve the access scope problem cleanly.
<br>
<br>Do we all agree this is a good solution? This could provide friend=20
<br>declarations as well:
<br>
<br>class X
<br>{
<br>=C2=A0 =C2=A0 =C2=A0 friend struct A;
<br>
<br>=C2=A0 =C2=A0 =C2=A0 struct A;
<br>=C2=A0 =C2=A0 =C2=A0 .... // ellipsis operator here
<br>};
<br>
<br>
<br>Regards,
<br>-Phil
<br>
<br></blockquote></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/228ebe66-fa3d-40e8-a42f-37de41834977%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/228ebe66-fa3d-40e8-a42f-37de41834977=
%40isocpp.org</a>.<br />

------=_Part_10215_1712949569.1526049034593--

------=_Part_10214_285001668.1526049034592--

.
