220 10673 <CAOfiQq=3ZFJycT=s=MpLB3-JmRbAwj02-=Og_C-U_HUxjs5d6Q@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: Forward declaring names
Date: Fri, 16 May 2014 16:37:23 -0700
Lines: 117
Approved: news@gmane.org
Message-ID: <CAOfiQq=3ZFJycT=s=MpLB3-JmRbAwj02-=Og_C-U_HUxjs5d6Q@mail.gmail.com>
References: <20140509221552.GA32099@sara.home>
	<d4ee93a3-8c94-4d21-aa9b-5497e4072f19@isocpp.org>
	<CAOfiQqmpXaFPtX+Ndh+GN1LYHRgr-XCkFqM-UtjM_CAexXjNZQ@mail.gmail.com>
	<ba0d3f23-ce26-461c-8e9a-1b6cc5716266@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=047d7b6dc67a3bc16204f98ce5bd
X-Trace: ger.gmane.org 1400283457 6667 80.91.229.3 (16 May 2014 23:37:37 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 16 May 2014 23:37:37 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDVNBJG4YAIBBM6C3KNQKGQELT5SHHQ@isocpp.org Sat May 17 01:37:30 2014
Return-path: <std-proposals+bncBDVNBJG4YAIBBM6C3KNQKGQELT5SHHQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ve0-f199.google.com ([209.85.128.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDVNBJG4YAIBBM6C3KNQKGQELT5SHHQ@isocpp.org>)
	id 1WlRgr-00056l-8f
	for gclcip-std-proposals@m.gmane.org; Sat, 17 May 2014 01:37:25 +0200
Original-Received: by mail-ve0-f199.google.com with SMTP id oz11sf12535576veb.10
        for <gclcip-std-proposals@m.gmane.org>; Fri, 16 May 2014 16:37:24 -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=lgF5I2ExpJAeAjsRe1EpKti4DWlvmatzxLdKFFkGUlg=;
        b=g4IHbdDnpwPmX6qrp69K/ZReSsMDcn92knO/VUuiwDj5cY7nLTsk02mjqLG0LQydvc
         foRPQ/pGAEyjUrNzT/uT1slIMjRmCgSfxW4nxjFuWXwcd1dMKlHRPd5eq5E63LjnqVvE
         IOvqM3pgqUo83WnOoq5AeAXyfk64Jj2FzT27NU4yZnpazz7wMWL9vIyWLyd7EHjFxnHu
         JjFTce9Yh1LD9J9zED9jJevAXQ1Ibenf1RlHGO6V16zb7BnfeC0gpdMgKgWpJB7J9TFx
         jVC4tJ5S8e1BLNfafr3ReG2AXrRqFvN3LmS4f0RZ50ts0LVMBuhKiqf9YvxE2J/8BSnF
         55SA==
X-Gm-Message-State: ALoCoQngPL/0TQftJuFRixHWgBNRnC7zEG5a/uwhj9H54TQMaAtqZZ0FxHWdPoivWxbkUjtiCMxz
X-Received: by 10.224.147.72 with SMTP id k8mr8882657qav.5.1400283444325;
        Fri, 16 May 2014 16:37:24 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.25.171 with SMTP id 40ls929031qgt.85.gmail; Fri, 16 May
 2014 16:37:23 -0700 (PDT)
X-Received: by 10.221.26.10 with SMTP id rk10mr16785639vcb.0.1400283443728;
        Fri, 16 May 2014 16:37:23 -0700 (PDT)
Original-Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [2607:f8b0:400c:c01::235])
        by mx.google.com with ESMTPS id b4si2016534vck.7.2014.05.16.16.37.23
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 16 May 2014 16:37:23 -0700 (PDT)
Received-SPF: pass (google.com: domain of metafoo@gmail.com designates 2607:f8b0:400c:c01::235 as permitted sender) client-ip=2607:f8b0:400c:c01::235;
Original-Received: by mail-ve0-f181.google.com with SMTP id pa12so3871878veb.26
        for <std-proposals@isocpp.org>; Fri, 16 May 2014 16:37:23 -0700 (PDT)
X-Received: by 10.58.198.107 with SMTP id jb11mr16835948vec.10.1400283443477;
 Fri, 16 May 2014 16:37:23 -0700 (PDT)
Original-Sender: metafoo@gmail.com
Original-Received: by 10.58.218.131 with HTTP; Fri, 16 May 2014 16:37:23 -0700 (PDT)
In-Reply-To: <ba0d3f23-ce26-461c-8e9a-1b6cc5716266@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::235 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:10673
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/10673>

--047d7b6dc67a3bc16204f98ce5bd
Content-Type: text/plain; charset=UTF-8

On Fri, May 16, 2014 at 4:16 PM, <gmisocpp@gmail.com> wrote:

>
> On Saturday, May 17, 2014 10:36:44 AM UTC+12, Richard Smith wrote:
>
>> On Fri, May 16, 2014 at 2:41 PM, Stack Machine <stackm...@hotmail.com>wrote:
>>
>>> Forward declarations are a stupid idea to begin with and should not be
>>> expanded on. The solution to this should be Modules.
>>>
>>
>> I generally agree, but with just a pinch of caution: forward declarations
>> serve two purposes: reducing include dependencies and breaking cycles.
>> Modules only helps with the first problem; we still need forward
>> declarations for the second problem.
>>
>
> How about:
>
> auto HANDLE;
>

Something like 'typename HANDLE;' would probably be more appropriate, since
this is a type, not a variable.

void (HANDLE& x);
>
> Meaning: "Hey compiler HANDLE might be a class, struct, typedef, or
> whatever, but if you don't need to know, just go with it knowing it's not a
> spelling mistake."
>
> Is that what the OP wanted, and would it work?
>

I can't answer the first half of this question =)

Yes, this could work, but the type would need to be properly-declared
before you could define or call this function, so it's not clear to me how
useful this would be. (This level of opaqueness goes beyond being a merely
incomplete type, since you don't even know how to represent a pointer or
reference to the type.)

-- 

--- 
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/.

--047d7b6dc67a3bc16204f98ce5bd
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On F=
ri, May 16, 2014 at 4:16 PM,  <span dir=3D"ltr">&lt;<a href=3D"mailto:gmiso=
cpp@gmail.com" target=3D"_blank">gmisocpp@gmail.com</a>&gt;</span> wrote:<b=
r><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:=
1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr"><br>On Saturday, May 17, 2014 10:36:44 AM UTC+12, Richard =
Smith wrote:<div class=3D""><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);bo=
rder-left-width:1px;border-left-style:solid">
<div dir=3D"ltr"><div><div class=3D"gmail_quote">On Fri, May 16, 2014 at 2:=
41 PM, Stack Machine <span dir=3D"ltr">&lt;<a>stackm...@hotmail.com</a>&gt;=
</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding=
-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-l=
eft-style:solid"><div dir=3D"ltr">Forward declarations are a stupid idea to=
 begin with and should not be expanded on. The solution to this should be M=
odules.</div>

</blockquote><div><br></div><div>I generally agree, but with just a pinch o=
f caution: forward declarations serve two purposes: reducing include depend=
encies and breaking cycles. Modules only helps with the first problem; we s=
till need forward declarations for the second problem.</div>
</div></div></div></blockquote><div><br></div></div><div>How about:</div><d=
iv><br></div><div>auto HANDLE;</div></div></blockquote><div><br></div><div>=
Something like &#39;typename HANDLE;&#39; would probably be more appropriat=
e, since this is a type, not a variable.</div>
<div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>void (H=
ANDLE&amp;=C2=A0x);=C2=A0</div><div><br></div><div><div>Meaning: &quot;Hey =
compiler=C2=A0HANDLE=C2=A0might be=C2=A0a class, struct, typedef, or whatev=
er, but=C2=A0if you don&#39;t need to know, just go with it knowing it&#39;=
s not a spelling mistake.&quot;</div>
<div><br></div><div>Is that what the OP wanted, and would it work?</div></d=
iv></div></blockquote><div><br></div><div>I can&#39;t answer the first half=
 of this question =3D)</div><div><br></div><div>Yes, this could work, but t=
he type would need to be properly-declared before you could define or call =
this function, so it&#39;s not clear to me how useful this would be. (This =
level of opaqueness goes beyond being a merely incomplete type, since you d=
on&#39;t even know how to represent a pointer or reference to the type.)</d=
iv>
</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 />

--047d7b6dc67a3bc16204f98ce5bd--

.
