220 4113 <CAOHCbivK_6fqJFb+Zgx2Y=6_zOuONSceijG0JvB8uwunBc1MDg@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Tony V E <tvaneerd@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: A cleaner way to define nested class/structure
Date: Tue, 30 Apr 2013 13:08:48 -0400
Lines: 104
Approved: news@gmane.org
Message-ID: <CAOHCbivK_6fqJFb+Zgx2Y=6_zOuONSceijG0JvB8uwunBc1MDg@mail.gmail.com>
References: <27175469-a158-4bc1-9f30-66e3a647e931@isocpp.org>
	<CAGqM8fbzQuTd+udZRrrUoGLXtgm+RuP8pSYPv=bBDpxMxSNmMA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=f46d04071533fdc62e04db970d70
X-Trace: ger.gmane.org 1367341783 9650 80.91.229.3 (30 Apr 2013 17:09:43 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 30 Apr 2013 17:09:43 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCUZ5QWKNQIKD5P7RMCRUBEI4ISPW@isocpp.org Tue Apr 30 19:09:41 2013
Return-path: <std-proposals+bncBCUZ5QWKNQIKD5P7RMCRUBEI4ISPW@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ea0-f198.google.com ([209.85.215.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCUZ5QWKNQIKD5P7RMCRUBEI4ISPW@isocpp.org>)
	id 1UXE2s-0004ZE-JV
	for gclcip-std-proposals@m.gmane.org; Tue, 30 Apr 2013 19:08:50 +0200
Original-Received: by mail-ea0-f198.google.com with SMTP id a11sf1020422eae.5
        for <gclcip-std-proposals@m.gmane.org>; Tue, 30 Apr 2013 10:08:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-received:x-beenthere:x-received:received-spf:mime-version
         :x-received:in-reply-to:references:date:message-id:subject:from:to
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-google-group-id:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe:content-type;
        bh=XtDJF30ApKlyfnwb32Skf1BP2nl7Z7l8Iz8BgEuN0aY=;
        b=GRDa8eDOnAeMPXhAhr0bAkOOPEg9Y/wyh+TG4890S0Dn+FTe2SHGIzgHOXLsPaQOLR
         +cJHvlqqCrI7GTj0AogNzvatqEYUBcaisCAD9yWNKh+XAXzqwZ9y4oYW7lWfUkHjylDy
         V4UwCg1wOkinA6zJqo7Y5CdMiuUEsOgmQnVD7B4HzVSfbk7TLeJESWstVZKGS+EoduqH
         2slVaNtPUAJ6REiD9jXu/5bIlz/QCVOos4drETaZgYfhMCx5M+5dT28PT44AqHpNG+Yh
         U8wzPody0T528y7nuwObeT6+cycmPZBmt7J7bv5DxneVUbqvevYphLmxNsfRGuGvwbCP
  
X-Received: by 10.112.140.135 with SMTP id rg7mr13989145lbb.9.1367341729723;
        Tue, 30 Apr 2013 10:08:49 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.26.136 with SMTP id l8ls41558lag.104.gmail; Tue, 30 Apr
 2013 10:08:49 -0700 (PDT)
X-Received: by 10.112.144.165 with SMTP id sn5mr22742567lbb.48.1367341729251;
        Tue, 30 Apr 2013 10:08:49 -0700 (PDT)
Original-Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175])
        by mx.google.com with ESMTPS id rb3si6912388lbb.247.2013.04.30.10.08.48
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 30 Apr 2013 10:08:48 -0700 (PDT)
Received-SPF: pass (google.com: domain of tvaneerd@gmail.com designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175;
Original-Received: by mail-lb0-f175.google.com with SMTP id w20so732937lbh.6
        for <std-proposals@isocpp.org>; Tue, 30 Apr 2013 10:08:48 -0700 (PDT)
X-Received: by 10.152.112.231 with SMTP id it7mr29521482lab.10.1367341728120;
 Tue, 30 Apr 2013 10:08:48 -0700 (PDT)
Original-Received: by 10.112.2.167 with HTTP; Tue, 30 Apr 2013 10:08:48 -0700 (PDT)
In-Reply-To: <CAGqM8fbzQuTd+udZRrrUoGLXtgm+RuP8pSYPv=bBDpxMxSNmMA@mail.gmail.com>
X-Original-Sender: tvaneerd@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of tvaneerd@gmail.com designates 209.85.217.175 as permitted sender)
 smtp.mail=tvaneerd@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?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:4113
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4113>

--f46d04071533fdc62e04db970d70
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Apr 29, 2013 at 2:57 PM, Lawrence Crowl <crowl@googlers.com> wrote:

>
> Why isn't the following solution sufficient?
>
> class Outer {
>   class Inner1 {
>     int i1;
>   };
>   class Inner2;
>   Inner1 inner1;
>   Inner2 *inner2;
> };
>
> class Outer::Inner2 {
>   int i2;
> };
>
> --
> Lawrence Crowl
>
>
It isn't very nice when Inner1 is large.

Same with inline member functions - you can define them inside the class,
but sometimes it is nicer to define them after the class (yet still in the
header, still inline).
The only difference with inner classes would be that you would need to
define them first.

You see similar things in boost libraries that use the boost::detail
namespace.  (There are other reasons to put stuff in boost::detail, inner
classes is just one.)

Tony

-- 

--- 
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/?hl=en.



--f46d04071533fdc62e04db970d70
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Mon, Apr 29, 2013 at 2:57 PM, Lawrence Crowl <span dir=3D"ltr">&=
lt;<a href=3D"mailto:crowl@googlers.com" target=3D"_blank">crowl@googlers.c=
om</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5"><br>
</div></div>Why isn&#39;t the following solution sufficient?<br>
<br>
class Outer {<br>
=A0 class Inner1 {<br>
=A0 =A0 int i1;<br>
<div class=3D"im HOEnZb">=A0 };<br>
=A0 class Inner2;<br>
=A0 Inner1 inner1;<br>
=A0 Inner2 *inner2;<br>
};<br>
<br>
class Outer::Inner2 {<br>
=A0 int i2;<br>
};<br>
<br>
</div><span class=3D"HOEnZb"><font color=3D"#888888">--<br>
Lawrence Crowl</font></span><div class=3D"HOEnZb"><div class=3D"h5"><br></d=
iv></div></blockquote><div><br></div><div>It isn&#39;t very nice when Inner=
1 is large.<br><br></div><div>Same with inline member functions - you can d=
efine them inside the class, but sometimes it is nicer to define them after=
 the class (yet still in the header, still inline).<br>
</div><div>The only difference with inner classes would be that you would n=
eed to define them first.<br><br></div><div>You see similar things in boost=
 libraries that use the boost::detail namespace.=A0 (There are other reason=
s to put stuff in boost::detail, inner classes is just one.)<br>
<br>Tony<br><br></div></div><br></div></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--f46d04071533fdc62e04db970d70--

.
