Topic: A cleaner way to define nested class/structure
Author: Hariharan Subramanian <tohari@gmail.com>
Date: Mon, 29 Apr 2013 00:07:16 -0700 (PDT)
Raw View
------=_Part_28_17440801.1367219236949
Content-Type: text/plain; charset=ISO-8859-1
Problem:
class Outer {
class Inner1;
class Inner2;
Inner1 inner1;
Inner2 *inner2;
};
class Outer::Inner1 {
int i1;
};
class Outer::Inner2 {
int i2;
};
The code above results in compilation error because the class Inner1 is not
defined before the declaration of the object inner1. Inner2 obviously has
no problem.Defining the nested classes within the Outer class hampers
readability.
Solution:
class Outer; //Declare the Outer class
class Outer::Inner1 { //Define the Inner1 class
int i1;
};
class Outer { //If this class is not defined in the same
compilation unit then it should result in an error because Inner1 is
defined as a nested class but the nesting class is undefined.
class Inner1; //If this is absent then it should result in compilation
error
class Inner2;
Inner1 inner1;
Inner2 *inner2;
};
class Outer::Inner2 {
int i2;
};
This solution honours the C++ convention that the class must be defined
before creating an object of its type. This certainly improves readability.
Hariharan S
--
---
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.
------=_Part_28_17440801.1367219236949
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div>Problem:</div><div><br></div><div>class Outer {</div><div><span class=
=3D"Apple-tab-span" style=3D"white-space:pre"> </span>class Inner1;</div><d=
iv><span class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>class=
Inner2;<br></div><div><br></div><div><span class=3D"Apple-tab-span" style=
=3D"white-space:pre"> </span>Inner1 inner1;</div><div><span class=3D"Apple-=
tab-span" style=3D"white-space: pre;"> </span>Inner2 *inner2;</div><div>};<=
/div><div><br></div><div>class Outer::Inner1 {</div><div><span class=3D"App=
le-tab-span" style=3D"white-space:pre"> </span>int i1;</div><div>};</div><d=
iv><br></div><div><div>class Outer::Inner2 {</div><div><span class=3D"Apple=
-tab-span" style=3D"white-space: pre;"> </span>int i2;</div><div>};</div></=
div><div><br></div><div>The code above results in compilation error because=
the class Inner1 is not defined before the declaration of the object inner=
1. Inner2 obviously has no problem.Defining the nested classes within the O=
uter class hampers readability.</div><div><br></div><div>Solution:</div><di=
v><br></div><div>class Outer; //Declare the Outer class</div><div><br></div=
><div><div>class Outer::Inner1 { //Define the Inner1 class</div><div><span =
class=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>int i1;</div><=
div>};</div></div><div><br></div><div><div>class Outer { &nbs=
p; //If this class is not defined in the same compilation uni=
t then it should result in an error because Inner1 is defined as a nested c=
lass but the nesting class is undefined.</div><div><span class=3D"Apple-tab=
-span" style=3D"white-space: pre;"> </span>class Inner1; //If this i=
s absent then it should result in compilation error</div><div><span class=
=3D"Apple-tab-span" style=3D"white-space: pre;"> </span>class Inner2;<br></=
div><div><br></div><div><span class=3D"Apple-tab-span" style=3D"white-space=
: pre;"> </span>Inner1 inner1;</div><div><span class=3D"Apple-tab-span" sty=
le=3D"white-space: pre;"> </span>Inner2 *inner2;</div><div>};</div></div><d=
iv><br></div><div><div><div>class Outer::Inner2 {</div><div><span class=3D"=
Apple-tab-span" style=3D"white-space: pre;"> </span>int i2;</div><div>};</d=
iv></div></div><div><br></div><div>This solution honours the C++ convention=
that the class must be defined before creating an object of its type. This=
certainly improves readability.</div><div><br></div><div>Hariharan S</div>=
<div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
------=_Part_28_17440801.1367219236949--
.
Author: Lawrence Crowl <crowl@googlers.com>
Date: Mon, 29 Apr 2013 11:57:53 -0700
Raw View
On 4/29/13, Hariharan Subramanian <tohari@gmail.com> wrote:
> Problem:
>
> class Outer {
> class Inner1;
> class Inner2;
>
> Inner1 inner1;
> Inner2 *inner2;
> };
>
> class Outer::Inner1 {
> int i1;
> };
>
> class Outer::Inner2 {
> int i2;
> };
>
> The code above results in compilation error because the class Inner1 is not
>
> defined before the declaration of the object inner1. Inner2 obviously has
> no problem.Defining the nested classes within the Outer class hampers
> readability.
>
> Solution:
>
> class Outer; //Declare the Outer class
>
> class Outer::Inner1 { //Define the Inner1 class
> int i1;
> };
>
> class Outer { //If this class is not defined in the same
> compilation unit then it should result in an error because Inner1 is
> defined as a nested class but the nesting class is undefined.
> class Inner1; //If this is absent then it should result in compilation
> error
> class Inner2;
>
> Inner1 inner1;
> Inner2 *inner2;
> };
>
> class Outer::Inner2 {
> int i2;
> };
>
> This solution honours the C++ convention that the class must be defined
> before creating an object of its type. This certainly improves readability.
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
--
---
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.
.
Author: Hariharan Subramanian <tohari@gmail.com>
Date: Tue, 30 Apr 2013 10:50:49 +0530
Raw View
--047d7b3441d613207404db8d2a1a
Content-Type: text/plain; charset=ISO-8859-1
It is sufficient but I think it is incomplete. I am able to define a nested
class outside as long as I have a pointer/reference variable. This proposal
completes it by giving the ability to define the nested class outside even
if we have an object. This improves readability. This is as good as (or as
bad as) the existing one.
On Tue, Apr 30, 2013 at 12:27 AM, Lawrence Crowl <crowl@googlers.com> wrote:
> On 4/29/13, Hariharan Subramanian <tohari@gmail.com> wrote:
> > Problem:
> >
> > class Outer {
> > class Inner1;
> > class Inner2;
> >
> > Inner1 inner1;
> > Inner2 *inner2;
> > };
> >
> > class Outer::Inner1 {
> > int i1;
> > };
> >
> > class Outer::Inner2 {
> > int i2;
> > };
> >
> > The code above results in compilation error because the class Inner1 is
> not
> >
> > defined before the declaration of the object inner1. Inner2 obviously has
> > no problem.Defining the nested classes within the Outer class hampers
> > readability.
> >
> > Solution:
> >
> > class Outer; //Declare the Outer class
> >
> > class Outer::Inner1 { //Define the Inner1 class
> > int i1;
> > };
> >
> > class Outer { //If this class is not defined in the same
> > compilation unit then it should result in an error because Inner1 is
> > defined as a nested class but the nesting class is undefined.
> > class Inner1; //If this is absent then it should result in compilation
> > error
> > class Inner2;
> >
> > Inner1 inner1;
> > Inner2 *inner2;
> > };
> >
> > class Outer::Inner2 {
> > int i2;
> > };
> >
> > This solution honours the C++ convention that the class must be defined
> > before creating an object of its type. This certainly improves
> readability.
>
> 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
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/a/isocpp.org/d/topic/std-proposals/l865qYE3Wa8/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, 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.
>
>
>
--
---
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.
--047d7b3441d613207404db8d2a1a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">It is sufficient but I think it is incomplete. I am able t=
o define a nested class outside as long as I have a pointer/reference varia=
ble. This proposal completes it by giving the ability to define the nested =
class outside even if we have an object. This improves readability. This is=
as good as (or as bad as) the existing one.</div>
<div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Tue, Apr 3=
0, 2013 at 12:27 AM, Lawrence Crowl <span dir=3D"ltr"><<a href=3D"mailto=
:crowl@googlers.com" target=3D"_blank">crowl@googlers.com</a>></span> wr=
ote:<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">On 4=
/29/13, Hariharan Subramanian <<a href=3D"mailto:tohari@gmail.com">tohar=
i@gmail.com</a>> wrote:<br>
> Problem:<br>
><br>
> class Outer {<br>
> class Inner1;<br>
> class Inner2;<br>
><br>
> Inner1 inner1;<br>
> Inner2 *inner2;<br>
> };<br>
><br>
> class Outer::Inner1 {<br>
> int i1;<br>
> };<br>
><br>
> class Outer::Inner2 {<br>
> int i2;<br>
> };<br>
><br>
> The code above results in compilation error because the class Inner1 i=
s not<br>
><br>
> defined before the declaration of the object inner1. Inner2 obviously =
has<br>
> no problem.Defining the nested classes within the Outer class hampers<=
br>
> readability.<br>
><br>
> Solution:<br>
><br>
> class Outer; //Declare the Outer class<br>
><br>
> class Outer::Inner1 { //Define the Inner1 class<br>
> int i1;<br>
> };<br>
><br>
> class Outer { =A0 =A0 =A0 =A0 =A0 //If this class is not defined in th=
e same<br>
> compilation unit then it should result in an error because Inner1 is<b=
r>
> defined as a nested class but the nesting class is undefined.<br>
> class Inner1; =A0 //If this is absent then it should result in compila=
tion<br>
> error<br>
> class Inner2;<br>
><br>
> Inner1 inner1;<br>
> Inner2 *inner2;<br>
> };<br>
><br>
> class Outer::Inner2 {<br>
> int i2;<br>
> };<br>
><br>
> This solution honours the C++ convention that the class must be define=
d<br>
> before creating an object of its type. This certainly improves readabi=
lity.<br>
<br>
</div></div>Why isn'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<br>
</font></span><div class=3D"HOEnZb"><div class=3D"h5"><br>
--<br>
<br>
---<br>
You received this message because you are subscribed to a topic in the Goog=
le Groups "ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this topic, visit <a href=3D"https://groups.google.com/=
a/isocpp.org/d/topic/std-proposals/l865qYE3Wa8/unsubscribe?hl=3Den" target=
=3D"_blank">https://groups.google.com/a/isocpp.org/d/topic/std-proposals/l8=
65qYE3Wa8/unsubscribe?hl=3Den</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href=
=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-proposals+unsubscrib=
e@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/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
<br>
<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
--047d7b3441d613207404db8d2a1a--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Tue, 30 Apr 2013 13:08:48 -0400
Raw View
--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>></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'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'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 />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
--f46d04071533fdc62e04db970d70--
.
Author: Lawrence Crowl <crowl@googlers.com>
Date: Tue, 30 Apr 2013 10:49:20 -0700
Raw View
On Apr 29, 2013 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;
> };
On Apr 29, 2013 Hariharan Subramanian <tohari@gmail.com> wrote:
> It is sufficient but I think it is incomplete. I am able to define
> a nested class outside as long as I have a pointer/reference
> variable. This proposal completes it by giving the ability to
> define the nested class outside even if we have an object. This
> improves readability. This is as good as (or as bad as) the
> existing one.
On 4/30/13, Tony V E <tvaneerd@gmail.com> wrote:
> 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.)
Okay, so you two have two reasons, useful generality and readability.
Now we need a discussion of any potential language ambiguities, the
costs of implementation, and eventually wording changes to the
standard. All of this should be collected into a formal paper for
a meeting. The next one is in Chicago this fall, but the committee
might be extra busy getting C++14 out, so were I you, I would shoot
for the meeting after that.
--
Lawrence Crowl
--
---
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.
.
Author: Hariharan Subramanian <tohari@gmail.com>
Date: Thu, 2 May 2013 11:11:32 +0530
Raw View
--047d7b3a7d92d26eb404dbb5afde
Content-Type: text/plain; charset=ISO-8859-1
Iteration 2:
class Outer;
class Outer::Inner1 {
int i;
};
Outer::Inner1 *i1;
//The above should result in compilation error. Because we do not know yet
if Inner1 is private or public
//even though we are just declaring a pointer. It should wait till we
define the Outer class.
class Outer {
public:
class Inner1; //non-declaration of this should be a compilation error
class Inner2;
private:
Inner1 inner1; //No issues
Inner2 *inner2; //No issues
};
class Outer::Inner2 {
int j;
};
Outer::Inner1 *i1; //No compilation error because we know that it's public
--------
Because Inner1 is usable outside only after the Outer class is defined
there should be no other change to the language specification.
Regards,
Hariharan S
On Tue, Apr 30, 2013 at 11:19 PM, Lawrence Crowl <crowl@googlers.com> wrote:
> On Apr 29, 2013 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;
> > };
>
> On Apr 29, 2013 Hariharan Subramanian <tohari@gmail.com> wrote:
> > It is sufficient but I think it is incomplete. I am able to define
> > a nested class outside as long as I have a pointer/reference
> > variable. This proposal completes it by giving the ability to
> > define the nested class outside even if we have an object. This
> > improves readability. This is as good as (or as bad as) the
> > existing one.
>
> On 4/30/13, Tony V E <tvaneerd@gmail.com> wrote:
> > 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.)
>
> Okay, so you two have two reasons, useful generality and readability.
> Now we need a discussion of any potential language ambiguities, the
> costs of implementation, and eventually wording changes to the
> standard. All of this should be collected into a formal paper for
> a meeting. The next one is in Chicago this fall, but the committee
> might be extra busy getting C++14 out, so were I you, I would shoot
> for the meeting after that.
>
> --
> Lawrence Crowl
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/a/isocpp.org/d/topic/std-proposals/l865qYE3Wa8/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, 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.
>
>
>
--
---
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.
--047d7b3a7d92d26eb404dbb5afde
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Iteration 2:<div><br></div><div style>class Outer;</div><d=
iv style><br></div><div style>class Outer::Inner1 {</div><div style>=A0 =A0=
=A0 int i;</div><div style>};</div><div style><br></div><div style>Outer::=
Inner1 *i1;</div>
<div style>//The above should result in compilation error. Because we do no=
t know yet if Inner1 is private or public</div><div style>//even though we =
are just declaring a pointer. It should wait till we define the Outer class=
..</div>
<div style><br></div><div style>class Outer {</div><div style>public:</div>=
<div style>=A0 =A0 class Inner1; =A0//non-declaration of this should be a c=
ompilation error</div><div style>=A0 =A0 class Inner2;</div><div style><br>=
</div>
<div style>private:</div><div style>=A0 =A0Inner1 inner1; =A0 //No issues</=
div><div style>=A0 =A0Inner2 *inner2; =A0//No issues</div><div style>};</di=
v><div style><br></div><div style>class Outer::Inner2 {</div><div style>=A0=
=A0int j;</div>
<div style>};</div><div style><br></div><div style>Outer::Inner1 *i1; //No =
compilation error because we know that it's public</div><div style><br>=
</div><div style>--------</div><div style><br></div><div style>Because Inne=
r1 is usable outside only after the Outer class is defined there should be =
no other change to the language specification.</div>
<div style><br></div><div style>Regards,</div><div style>Hariharan S</div><=
div style><br></div></div><div class=3D"gmail_extra"><br><br><div class=3D"=
gmail_quote">On Tue, Apr 30, 2013 at 11:19 PM, Lawrence Crowl <span dir=3D"=
ltr"><<a href=3D"mailto:crowl@googlers.com" target=3D"_blank">crowl@goog=
lers.com</a>></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"im">On Apr 29, 2013 Lawrence C=
rowl <<a href=3D"mailto:crowl@googlers.com">crowl@googlers.com</a>> w=
rote:<br>
> Why isn't the following solution sufficient?<br>
><br>
> class Outer {<br>
> =A0 class Inner1 {<br>
> =A0 =A0 int i1;<br>
> =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><div class=3D"im">On Apr 29, 2013 Hariharan Subramanian <<a href=
=3D"mailto:tohari@gmail.com">tohari@gmail.com</a>> wrote:<br>
> It is sufficient but I think it is incomplete. I am able to define<br>
> a nested class outside as long as I have a pointer/reference<br>
> variable. This proposal completes it by giving the ability to<br>
> define the nested class outside even if we have an object. This<br>
> improves readability. This is as good as (or as bad as) the<br>
> existing one.<br>
<br>
</div><div class=3D"im">On 4/30/13, Tony V E <<a href=3D"mailto:tvaneerd=
@gmail.com">tvaneerd@gmail.com</a>> wrote:<br>
> It isn't very nice when Inner1 is large.<br>
><br>
> Same with inline member functions - you can define them inside the<br>
> class, but sometimes it is nicer to define them after the class<br>
> (yet still in the header, still inline). =A0The only difference with<b=
r>
> inner classes would be that you would need to define them first.<br>
><br>
> You see similar things in boost libraries that use the<br>
> boost::detail namespace. =A0(There are other reasons to put stuff<br>
> in boost::detail, inner classes is just one.)<br>
<br>
</div>Okay, so you two have two reasons, useful generality and readability.=
<br>
Now we need a discussion of any potential language ambiguities, the<br>
costs of implementation, and eventually wording changes to the<br>
standard. =A0All of this should be collected into a formal paper for<br>
a meeting. =A0The next one is in Chicago this fall, but the committee<br>
might be extra busy getting C++14 out, so were I you, I would shoot<br>
for the meeting after that.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
--<br>
Lawrence Crowl<br>
</font></span><div class=3D"HOEnZb"><div class=3D"h5"><br>
--<br>
<br>
---<br>
You received this message because you are subscribed to a topic in the Goog=
le Groups "ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this topic, visit <a href=3D"https://groups.google.com/=
a/isocpp.org/d/topic/std-proposals/l865qYE3Wa8/unsubscribe?hl=3Den" target=
=3D"_blank">https://groups.google.com/a/isocpp.org/d/topic/std-proposals/l8=
65qYE3Wa8/unsubscribe?hl=3Den</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href=
=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-proposals+unsubscrib=
e@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/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
<br>
<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
--047d7b3a7d92d26eb404dbb5afde--
.
Author: Lawrence Crowl <crowl@googlers.com>
Date: Tue, 7 May 2013 11:52:49 -0700
Raw View
On 5/1/13, Hariharan Subramanian <tohari@gmail.com> wrote:
> Iteration 2:
>
> class Outer;
>
> class Outer::Inner1 {
> int i;
> };
>
> Outer::Inner1 *i1;
> //The above should result in compilation error. Because we do not know yet
> if Inner1 is private or public
> //even though we are just declaring a pointer. It should wait till we
> define the Outer class.
>
> class Outer {
> public:
> class Inner1; //non-declaration of this should be a compilation error
> class Inner2;
>
> private:
> Inner1 inner1; //No issues
> Inner2 *inner2; //No issues
> };
>
> class Outer::Inner2 {
> int j;
> };
>
> Outer::Inner1 *i1; //No compilation error because we know that it's public
>
> --------
>
> Because Inner1 is usable outside only after the Outer class is defined
> there should be no other change to the language specification.
That is a good improvement.
>
> Regards,
> Hariharan S
>
>
>
> On Tue, Apr 30, 2013 at 11:19 PM, Lawrence Crowl <crowl@googlers.com>
> wrote:
>
>> On Apr 29, 2013 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;
>> > };
>>
>> On Apr 29, 2013 Hariharan Subramanian <tohari@gmail.com> wrote:
>> > It is sufficient but I think it is incomplete. I am able to define
>> > a nested class outside as long as I have a pointer/reference
>> > variable. This proposal completes it by giving the ability to
>> > define the nested class outside even if we have an object. This
>> > improves readability. This is as good as (or as bad as) the
>> > existing one.
>>
>> On 4/30/13, Tony V E <tvaneerd@gmail.com> wrote:
>> > 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.)
>>
>> Okay, so you two have two reasons, useful generality and readability.
>> Now we need a discussion of any potential language ambiguities, the
>> costs of implementation, and eventually wording changes to the
>> standard. All of this should be collected into a formal paper for
>> a meeting. The next one is in Chicago this fall, but the committee
>> might be extra busy getting C++14 out, so were I you, I would shoot
>> for the meeting after that.
>>
>> --
>> Lawrence Crowl
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/a/isocpp.org/d/topic/std-proposals/l865qYE3Wa8/unsubscribe?hl=en
>> .
>> To unsubscribe from this group and all its topics, 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.
>>
>>
>>
>
> --
>
> ---
> 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.
>
>
>
--
Lawrence Crowl
--
---
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.
.
Author: unituniverse.1@gmail.com
Date: Tue, 7 May 2013 12:40:01 -0700 (PDT)
Raw View
------=_Part_3194_5081380.1367955601341
Content-Type: text/plain; charset=ISO-8859-1
How about this:
template < typename _Ty1 >
class Outer
{
template < typename _Ty2 > class Inner;
};
// How to write Inner here?
And this:
class C1
{
};
class Outer
{
class C1;
};
//class Outer::C1 {}; // Any conflict?
--
---
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.
------=_Part_3194_5081380.1367955601341
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
How about this:<div>template < typename _Ty1 ></div><div>class Outer<=
/div><div>{</div><div> template < typename _Ty2 > class =
Inner;</div><div>};</div><div><br></div><div>// How to write Inner here?</d=
iv><div><br></div><div>And this:</div><div>class C1</div><div>{</div><div>}=
;</div><div><br></div><div>class Outer</div><div>{</div><div> class C=
1;</div><div>};</div><div><br></div><div>//class Outer::C1 {}; // Any confl=
ict?</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
------=_Part_3194_5081380.1367955601341--
.
Author: unituniverse.1@gmail.com
Date: Tue, 7 May 2013 12:41:05 -0700 (PDT)
Raw View
------=_Part_13_23901952.1367955665948
Content-Type: text/plain; charset=ISO-8859-1
How about this:
template < typename _Ty1 >
class Outer
{
template < typename _Ty2 > class Inner;
};
// How to write Inner here?
And this:
class C1
{
};
class Outer
{
class C1;
};
//class Outer::C1 {}; // Any conflict?
--
---
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.
------=_Part_13_23901952.1367955665948
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
How about this:<div>template < typename _Ty1 ></div><div>class Outer<=
/div><div>{</div><div> template < typename _Ty2 > class =
Inner;</div><div>};</div><div><br></div><div>// How to write Inner here?</d=
iv><div><br></div><div>And this:</div><div>class C1</div><div>{</div><div>}=
;</div><div><br></div><div>class Outer</div><div>{</div><div> class C=
1;</div><div>};</div><div><br></div><div>//class Outer::C1 {}; // Any confl=
ict?</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
------=_Part_13_23901952.1367955665948--
.
Author: unituniverse.1@gmail.com
Date: Tue, 7 May 2013 12:45:06 -0700 (PDT)
Raw View
------=_Part_3196_20735545.1367955906941
Content-Type: text/plain; charset=ISO-8859-1
A class declaration within a class C2 may be either importing another class
outside of C2 or a pre-declaration of a inner class of C2.
--
---
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.
------=_Part_3196_20735545.1367955906941
Content-Type: text/html; charset=ISO-8859-1
A class declaration within a class C2 may be either importing another class outside of C2 or a pre-declaration of a inner class of C2.<br>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email 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="http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en">http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en</a>.<br />
<br />
<br />
------=_Part_3196_20735545.1367955906941--
.
Author: Hariharan Subramanian <tohari@gmail.com>
Date: Thu, 9 May 2013 00:06:45 +0530
Raw View
--001a11c33a524ffe1704dc39370c
Content-Type: text/plain; charset=ISO-8859-1
On Wed, May 8, 2013 at 1:11 AM, <unituniverse.1@gmail.com> wrote:
> How about this:
> template < typename _Ty1 >
> class Outer
> {
> template < typename _Ty2 > class Inner;
> };
>
> // How to write Inner here?
>
It gives the user the capability to write the definition of inner class
even before the outer class is defined. Only the order is reversed. If we
can define Inner class after the Outer class we can use the same technique
to define the Inner class before defining the Outer class. So there is no
problem here.
And this:
> class C1
> {
> };
>
> class Outer
> {
> class C1;
> };
>
> //class Outer::C1 {}; // Any conflict?
>
Outer::C1 is defined after defining Outer class. So this is not related to
this proposal. The answer for your question is there is no conflict.
Regards,
Hariharan S
--
---
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.
--001a11c33a524ffe1704dc39370c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quo=
te">On Wed, May 8, 2013 at 1:11 AM, <span dir=3D"ltr"><<a href=3D"mailt=
o:unituniverse.1@gmail.com" target=3D"_blank">unituniverse.1@gmail.com</a>&=
gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div class=3D"im">How about this:<div>template < typena=
me _Ty1 ></div>
<div>class Outer</div><div>{</div><div>=A0 =A0 template < typename _Ty2 =
> class Inner;</div><div>};</div><div><br></div><div>// How to write Inn=
er here?</div></div></blockquote><div>=A0</div>It gives the user the capabi=
lity to write the definition of inner class even before the outer class is =
defined. Only the order is reversed. If we can define Inner class after the=
Outer class we can use the same technique to define the Inner class before=
defining the Outer class. So there is no problem here.<div>
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-sty=
le:solid;padding-left:1ex"><div class=3D"im"><div></div><div>And this:</div=
><div>
class C1</div><div>{</div><div>};</div><div><br></div><div>class Outer</div=
><div>{</div><div>=A0 class C1;</div><div>};</div><div><br></div><div>//cla=
ss Outer::C1 {}; // Any conflict?</div></div></blockquote><div><br></div>
<div style>Outer::C1 is defined after defining Outer class. So this is not =
related to this proposal. The answer for your question is there is no confl=
ict.</div><div style><br></div><div style>Regards,</div><div style>Harihara=
n S</div>
<div style><br></div></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" 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 />
<br />
<br />
--001a11c33a524ffe1704dc39370c--
.
Author: unituniverse.1@gmail.com
Date: Wed, 8 May 2013 12:04:44 -0700 (PDT)
Raw View
------=_Part_34_11309744.1368039884227
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=E5=9C=A8 2013=E5=B9=B45=E6=9C=888=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89UTC-4=
=E4=B8=8B=E5=8D=882=E6=97=B636=E5=88=8645=E7=A7=92=EF=BC=8CHariharan Subram=
anian=E5=86=99=E9=81=93=EF=BC=9A
>
>
>
> On Wed, May 8, 2013 at 1:11 AM, <unituni...@gmail.com <javascript:>>wrote=
:
>
>> How about this:
>> template < typename _Ty1 >
>> class Outer
>> {
>> template < typename _Ty2 > class Inner;
>> };
>>
>> // How to write Inner here?
>>
> =20
> It gives the user the capability to write the definition of inner class=
=20
> even before the outer class is defined. Only the order is reversed. If we=
=20
> can define Inner class after the Outer class we can use the same techniqu=
e=20
> to define the Inner class before defining the Outer class. So there is no=
=20
> problem here.
>
> And this:
>> class C1
>> {
>> };
>>
>> class Outer
>> {
>> class C1;
>> };
>>
>> //class Outer::C1 {}; // Any conflict?
>>
>
> Outer::C1 is defined after defining Outer class. So this is not related t=
o=20
> this proposal. The answer for your question is there is no conflict.
>
> Regards,
> Hariharan S
>
> you still gives no answer of the first question.
i mean how to write the template's definition if the Inner will be defined=
=20
as a nested class? or just provided a rule say: a nested class/structure=20
can't be defined outside of a class if it is a template (or if the outer is=
=20
a template)? or provided another formal of expression for template-nestes?
The second scope, as i asked before, currently the following code piece is=
=20
legal:
class C1 // ::C1
{
};
class Outer
{
class C1 // ::Outer::C1
{
};
class C1; // Declaration of the ::Outer::C1 but not ::C1
};
There is no conflict here.
Now, assuming if we plan to write a inner class C1 and put its definition=
=20
out of the class, how to sure that no conflict will exist?
Like the following steps:
step1: Creating a new project, nothing but a entry functions in your=20
source, then put the code here:
class Outer
{
class Inner;
};
class Outer::Inner
{
};
Compile. okay no problem. then, blablabla, then, including some header=20
files. but unfortunatly there is another global class named 'Inner' in=20
them(assuming the maker of the header files is insane...). Now what the=20
'class Inner;' in the definition scope of class Outer represents now?
--=20
---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.
------=_Part_34_11309744.1368039884227
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br>=E5=9C=A8 2013=E5=B9=B45=E6=9C=888=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=
=89UTC-4=E4=B8=8B=E5=8D=882=E6=97=B636=E5=88=8645=E7=A7=92=EF=BC=8CHarihara=
n Subramanian=E5=86=99=E9=81=93=EF=BC=9A<blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-le=
ft: 1ex;"><div dir=3D"ltr"><div><br><br><div class=3D"gmail_quote">On Wed, =
May 8, 2013 at 1:11 AM, <span dir=3D"ltr"><<a href=3D"javascript:" targ=
et=3D"_blank" gdf-obfuscated-mailto=3D"YKspXjrINUEJ">unituni...@gmail.com</=
a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div>How about this:<div>template < typename _Ty1 ><=
/div>
<div>class Outer</div><div>{</div><div> template < typename=
_Ty2 > class Inner;</div><div>};</div><div><br></div><div>// How to wri=
te Inner here?</div></div></blockquote><div> </div>It gives the user t=
he capability to write the definition of inner class even before the outer =
class is defined. Only the order is reversed. If we can define Inner class =
after the Outer class we can use the same technique to define the Inner cla=
ss before defining the Outer class. So there is no problem here.<div>
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-sty=
le:solid;padding-left:1ex"><div><div></div><div>And this:</div><div>
class C1</div><div>{</div><div>};</div><div><br></div><div>class Outer</div=
><div>{</div><div> class C1;</div><div>};</div><div><br></div><div>//=
class Outer::C1 {}; // Any conflict?</div></div></blockquote><div><br></div=
>
<div>Outer::C1 is defined after defining Outer class. So this is not relate=
d to this proposal. The answer for your question is there is no conflict.</=
div><div><br></div><div>Regards,</div><div>Hariharan S</div>
<div><br></div></div></div></div></blockquote><div>you still gives no answe=
r of the first question.</div><div>i mean how to write the template's defin=
ition if the Inner will be defined as a nested class? or just provided a ru=
le say: a nested class/structure can't be defined outside of a class if it =
is a template (or if the outer is a template)? or provided another formal o=
f expression for template-nestes?</div><div><br></div><div>The second scope=
, as i asked before, currently the following code piece is legal:</div><div=
><br></div><div><div><font color=3D"#000000">class C1 // ::C1</font></div><=
div><font color=3D"#000000">{</font></div><div><font color=3D"#000000">};</=
font></div><div><font color=3D"#000000"><br></font></div><div><font color=
=3D"#000000">class Outer</font></div><div><font color=3D"#000000">{</font><=
/div><div><font color=3D"#000000"> class C1 // ::Outer::C1</font></di=
v><div><font color=3D"#000000"> {</font></div><div><font color=3D"#00=
0000"> };</font></div><div><font color=3D"#000000"><br></font></div><=
div><font color=3D"#000000"> class C1; // Declaration of the </f=
ont><span style=3D"color: rgb(0, 0, 0);">::Outer::C1 but not ::C1</span></d=
iv><div><font color=3D"#000000">};</font></div></div><div><font color=3D"#0=
00000"><br></font></div><div><font color=3D"#000000">There is no conflict h=
ere.</font></div><div><font color=3D"#000000">Now, assuming if we plan to w=
rite a inner class C1 and put its definition out of the class, how to sure =
that no conflict will exist?</font></div><div><font color=3D"#000000">Like =
the following steps:</font></div><div><font color=3D"#000000">step1: Creati=
ng a new project, nothing but a entry functions in your source, then put th=
e code here:</font></div><div><br></div><div><div><div><font color=3D"#0000=
00">class Outer</font></div><div><font color=3D"#000000">{</font></div><div=
><font color=3D"#000000"> class Inner;</font></div><div><font color=
=3D"#000000">};</font></div></div></div><div><font color=3D"#000000"><br></=
font></div><div><font color=3D"#000000">class Outer::Inner</font></div><div=
><font color=3D"#000000">{</font></div><div><font color=3D"#000000">};</fon=
t></div><div><font color=3D"#000000">Compile. okay no problem. then, blabla=
bla, then, including some header files. but unfortunatly there is another g=
lobal class named 'Inner' in them(assuming the maker of the header files is=
insane...). Now what the 'class Inner;' in the definition scope of class O=
uter represents now?</font></div><div><font color=3D"#000000"><br></fo=
nt></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
------=_Part_34_11309744.1368039884227--
.
Author: unituniverse.1@gmail.com
Date: Wed, 8 May 2013 12:05:15 -0700 (PDT)
Raw View
------=_Part_2610_30967539.1368039915875
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=E5=9C=A8 2013=E5=B9=B45=E6=9C=888=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89UTC-4=
=E4=B8=8B=E5=8D=882=E6=97=B636=E5=88=8645=E7=A7=92=EF=BC=8CHariharan Subram=
anian=E5=86=99=E9=81=93=EF=BC=9A
>
>
>
> On Wed, May 8, 2013 at 1:11 AM, <unituni...@gmail.com <javascript:>>wrote=
:
>
>> How about this:
>> template < typename _Ty1 >
>> class Outer
>> {
>> template < typename _Ty2 > class Inner;
>> };
>>
>> // How to write Inner here?
>>
> =20
> It gives the user the capability to write the definition of inner class=
=20
> even before the outer class is defined. Only the order is reversed. If we=
=20
> can define Inner class after the Outer class we can use the same techniqu=
e=20
> to define the Inner class before defining the Outer class. So there is no=
=20
> problem here.
>
> And this:
>> class C1
>> {
>> };
>>
>> class Outer
>> {
>> class C1;
>> };
>>
>> //class Outer::C1 {}; // Any conflict?
>>
>
> Outer::C1 is defined after defining Outer class. So this is not related t=
o=20
> this proposal. The answer for your question is there is no conflict.
>
> Regards,
> Hariharan S
>
> you still gives no answer of the first question.
i mean how to write the template's definition if the Inner will be defined=
=20
as a nested class? or just provided a rule say: a nested class/structure=20
can't be defined outside of a class if it is a template (or if the outer is=
=20
a template)? or provided another formal of expression for template-nestes?
The second scope, as i asked before, currently the following code piece is=
=20
legal:
class C1 // ::C1
{
};
class Outer
{
class C1 // ::Outer::C1
{
};
class C1; // Declaration of the ::Outer::C1 but not ::C1
};
There is no conflict here.
Now, assuming if we plan to write a inner class C1 and put its definition=
=20
out of the class, how to sure that no conflict will exist?
Like the following steps:
step1: Creating a new project, nothing but a entry functions in your=20
source, then put the code here:
class Outer
{
class Inner;
};
class Outer::Inner
{
};
Compile. okay no problem. then, blablabla, then, including some header=20
files. but unfortunatly there is another global class named 'Inner' in=20
them(assuming the maker of the header files is insane...). Now what the=20
'class Inner;' in the definition scope of class Outer represents now?
--=20
---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.
------=_Part_2610_30967539.1368039915875
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br>=E5=9C=A8 2013=E5=B9=B45=E6=9C=888=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=
=89UTC-4=E4=B8=8B=E5=8D=882=E6=97=B636=E5=88=8645=E7=A7=92=EF=BC=8CHarihara=
n Subramanian=E5=86=99=E9=81=93=EF=BC=9A<blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-le=
ft: 1ex;"><div dir=3D"ltr"><div><br><br><div class=3D"gmail_quote">On Wed, =
May 8, 2013 at 1:11 AM, <span dir=3D"ltr"><<a href=3D"javascript:" targ=
et=3D"_blank" gdf-obfuscated-mailto=3D"YKspXjrINUEJ">unituni...@gmail.com</=
a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div>How about this:<div>template < typename _Ty1 ><=
/div>
<div>class Outer</div><div>{</div><div> template < typename=
_Ty2 > class Inner;</div><div>};</div><div><br></div><div>// How to wri=
te Inner here?</div></div></blockquote><div> </div>It gives the user t=
he capability to write the definition of inner class even before the outer =
class is defined. Only the order is reversed. If we can define Inner class =
after the Outer class we can use the same technique to define the Inner cla=
ss before defining the Outer class. So there is no problem here.<div>
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-sty=
le:solid;padding-left:1ex"><div><div></div><div>And this:</div><div>
class C1</div><div>{</div><div>};</div><div><br></div><div>class Outer</div=
><div>{</div><div> class C1;</div><div>};</div><div><br></div><div>//=
class Outer::C1 {}; // Any conflict?</div></div></blockquote><div><br></div=
>
<div>Outer::C1 is defined after defining Outer class. So this is not relate=
d to this proposal. The answer for your question is there is no conflict.</=
div><div><br></div><div>Regards,</div><div>Hariharan S</div>
<div><br></div></div></div></div></blockquote><div>you still gives no answe=
r of the first question.</div><div>i mean how to write the template's defin=
ition if the Inner will be defined as a nested class? or just provided a ru=
le say: a nested class/structure can't be defined outside of a class if it =
is a template (or if the outer is a template)? or provided another formal o=
f expression for template-nestes?</div><div><br></div><div>The second scope=
, as i asked before, currently the following code piece is legal:</div><div=
><br></div><div><div><font color=3D"#000000">class C1 // ::C1</font></div><=
div><font color=3D"#000000">{</font></div><div><font color=3D"#000000">};</=
font></div><div><font color=3D"#000000"><br></font></div><div><font color=
=3D"#000000">class Outer</font></div><div><font color=3D"#000000">{</font><=
/div><div><font color=3D"#000000"> class C1 // ::Outer::C1</font></di=
v><div><font color=3D"#000000"> {</font></div><div><font color=3D"#00=
0000"> };</font></div><div><font color=3D"#000000"><br></font></div><=
div><font color=3D"#000000"> class C1; // Declaration of the </f=
ont><span style=3D"color: rgb(0, 0, 0);">::Outer::C1 but not ::C1</span></d=
iv><div><font color=3D"#000000">};</font></div></div><div><font color=3D"#0=
00000"><br></font></div><div><font color=3D"#000000">There is no conflict h=
ere.</font></div><div><font color=3D"#000000">Now, assuming if we plan to w=
rite a inner class C1 and put its definition out of the class, how to sure =
that no conflict will exist?</font></div><div><font color=3D"#000000">Like =
the following steps:</font></div><div><font color=3D"#000000">step1: Creati=
ng a new project, nothing but a entry functions in your source, then put th=
e code here:</font></div><div><br></div><div><div><div><font color=3D"#0000=
00">class Outer</font></div><div><font color=3D"#000000">{</font></div><div=
><font color=3D"#000000"> class Inner;</font></div><div><font color=
=3D"#000000">};</font></div></div></div><div><font color=3D"#000000"><br></=
font></div><div><font color=3D"#000000">class Outer::Inner</font></div><div=
><font color=3D"#000000">{</font></div><div><font color=3D"#000000">};</fon=
t></div><div><font color=3D"#000000">Compile. okay no problem. then, blabla=
bla, then, including some header files. but unfortunatly there is another g=
lobal class named 'Inner' in them(assuming the maker of the header files is=
insane...). Now what the 'class Inner;' in the definition scope of class O=
uter represents now?</font></div><div><font color=3D"#000000"><br></fo=
nt></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
------=_Part_2610_30967539.1368039915875--
.
Author: Jonathan Wakely <cxx@kayari.org>
Date: Thu, 9 May 2013 03:16:45 -0700 (PDT)
Raw View
------=_Part_78_29118728.1368094605820
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wednesday, May 8, 2013 8:05:15 PM UTC+1, unituni...@gmail.com wrote:
>
>
>
> =E5=9C=A8 2013=E5=B9=B45=E6=9C=888=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89UTC=
-4=E4=B8=8B=E5=8D=882=E6=97=B636=E5=88=8645=E7=A7=92=EF=BC=8CHariharan Subr=
amanian=E5=86=99=E9=81=93=EF=BC=9A
>>
>>
>>
>> On Wed, May 8, 2013 at 1:11 AM, <unituni...@gmail.com> wrote:
>>
>>> How about this:
>>> template < typename _Ty1 >
>>> class Outer
>>> {
>>> template < typename _Ty2 > class Inner;
>>> };
>>>
>>> // How to write Inner here?
>>>
>> =20
>> It gives the user the capability to write the definition of inner class=
=20
>> even before the outer class is defined. Only the order is reversed. If w=
e=20
>> can define Inner class after the Outer class we can use the same techniq=
ue=20
>> to define the Inner class before defining the Outer class. So there is n=
o=20
>> problem here.
>>
>> And this:
>>> class C1
>>> {
>>> };
>>>
>>> class Outer
>>> {
>>> class C1;
>>> };
>>>
>>> //class Outer::C1 {}; // Any conflict?
>>>
>>
>> Outer::C1 is defined after defining Outer class. So this is not related=
=20
>> to this proposal. The answer for your question is there is no conflict.
>>
>> Regards,
>> Hariharan S
>>
>> you still gives no answer of the first question.
> i mean how to write the template's definition if the Inner will be define=
d=20
> as a nested class? or just provided a rule say: a nested class/structure=
=20
> can't be defined outside of a class if it is a template (or if the outer =
is=20
> a template)? or provided another formal of expression for template-nestes=
?
>
> The second scope, as i asked before, currently the following code piece i=
s=20
> legal:
>
> class C1 // ::C1
> {
> };
>
> class Outer
> {
> class C1 // ::Outer::C1
> {
> };
>
> class C1; // Declaration of the ::Outer::C1 but not ::C1
> };
>
> There is no conflict here.
> Now, assuming if we plan to write a inner class C1 and put its definition=
=20
> out of the class, how to sure that no conflict will exist?
> Like the following steps:
> step1: Creating a new project, nothing but a entry functions in your=20
> source, then put the code here:
>
> class Outer
> {
> class Inner;
> };
>
> class Outer::Inner
> {
> };
> Compile. okay no problem. then, blablabla, then, including some header=20
> files. but unfortunatly there is another global class named 'Inner' in=20
> them(assuming the maker of the header files is insane...). Now what the=
=20
> 'class Inner;' in the definition scope of class Outer represents now?
>
The same thing as it represents today, I don't understand your concern.
At namespace scope referring to Inner means ::Inner, referring to=20
Outer::Inner means Outer::Inner.
I don't like this proposal, but I don't think it has the problems you're=20
seeing.
=20
--=20
---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.
------=_Part_78_29118728.1368094605820
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br>On Wednesday, May 8, 2013 8:05:15 PM UTC+1, unituni...@gmail.com wr=
ote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex=
;border-left: 1px #ccc solid;padding-left: 1ex;"><br><br>=E5=9C=A8 2013=E5=
=B9=B45=E6=9C=888=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89UTC-4=E4=B8=8B=E5=8D=
=882=E6=97=B636=E5=88=8645=E7=A7=92=EF=BC=8C<wbr>Hariharan Subramanian=E5=
=86=99=E9=81=93=EF=BC=9A<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"><div><br><br><div class=3D"gmail_quote">On Wed, May 8, 2013 at 1:11 A=
M, <span dir=3D"ltr"><<a>unituni...@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div>How about this:<div>template < typename _Ty1 ><=
/div>
<div>class Outer</div><div>{</div><div> template < typename=
_Ty2 > class Inner;</div><div>};</div><div><br></div><div>// How to wri=
te Inner here?</div></div></blockquote><div> </div>It gives the user t=
he capability to write the definition of inner class even before the outer =
class is defined. Only the order is reversed. If we can define Inner class =
after the Outer class we can use the same technique to define the Inner cla=
ss before defining the Outer class. So there is no problem here.<div>
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8=
ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-sty=
le:solid;padding-left:1ex"><div><div></div><div>And this:</div><div>
class C1</div><div>{</div><div>};</div><div><br></div><div>class Outer</div=
><div>{</div><div> class C1;</div><div>};</div><div><br></div><div>//=
class Outer::C1 {}; // Any conflict?</div></div></blockquote><div><br></div=
>
<div>Outer::C1 is defined after defining Outer class. So this is not relate=
d to this proposal. The answer for your question is there is no conflict.</=
div><div><br></div><div>Regards,</div><div>Hariharan S</div>
<div><br></div></div></div></div></blockquote><div>you still gives no answe=
r of the first question.</div><div>i mean how to write the template's defin=
ition if the Inner will be defined as a nested class? or just provided a ru=
le say: a nested class/structure can't be defined outside of a class if it =
is a template (or if the outer is a template)? or provided another formal o=
f expression for template-nestes?</div><div><br></div><div>The second scope=
, as i asked before, currently the following code piece is legal:</div><div=
><br></div><div><div><font color=3D"#000000">class C1 // ::C1</font></div><=
div><font color=3D"#000000">{</font></div><div><font color=3D"#000000">};</=
font></div><div><font color=3D"#000000"><br></font></div><div><font color=
=3D"#000000">class Outer</font></div><div><font color=3D"#000000">{</font><=
/div><div><font color=3D"#000000"> class C1 // ::Outer::C1</font></di=
v><div><font color=3D"#000000"> {</font></div><div><font color=3D"#00=
0000"> };</font></div><div><font color=3D"#000000"><br></font></div><=
div><font color=3D"#000000"> class C1; // Declaration of the </f=
ont><span style=3D"color:rgb(0,0,0)">::Outer::C1 but not ::C1</span></div><=
div><font color=3D"#000000">};</font></div></div><div><font color=3D"#00000=
0"><br></font></div><div><font color=3D"#000000">There is no conflict here.=
</font></div><div><font color=3D"#000000">Now, assuming if we plan to write=
a inner class C1 and put its definition out of the class, how to sure that=
no conflict will exist?</font></div><div><font color=3D"#000000">Like the =
following steps:</font></div><div><font color=3D"#000000">step1: Creating a=
new project, nothing but a entry functions in your source, then put the co=
de here:</font></div><div><br></div><div><div><div><font color=3D"#000000">=
class Outer</font></div><div><font color=3D"#000000">{</font></div><div><fo=
nt color=3D"#000000"> class Inner;</font></div><div><font color=3D"#0=
00000">};</font></div></div></div><div><font color=3D"#000000"><br></font><=
/div><div><font color=3D"#000000">class Outer::Inner</font></div><div><font=
color=3D"#000000">{</font></div><div><font color=3D"#000000">};</font></di=
v><div><font color=3D"#000000">Compile. okay no problem. then, blablabla, t=
hen, including some header files. but unfortunatly there is another global =
class named 'Inner' in them(assuming the maker of the header files is insan=
e...). Now what the 'class Inner;' in the definition scope of class Outer&n=
bsp;represents now?</font></div></blockquote><div><br>The same thing as it =
represents today, I don't understand your concern.<br><br>At namespace scop=
e referring to Inner means ::Inner, referring to Outer::Inner means Outer::=
Inner.<br><br>I don't like this proposal, but I don't think it has the prob=
lems you're seeing.<br><br> <br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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 />
<br />
<br />
------=_Part_78_29118728.1368094605820--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Fri, 10 May 2013 12:46:06 -0400
Raw View
--089e013d14ca4004b804dc5fe7d5
Content-Type: text/plain; charset=ISO-8859-1
On Tue, May 7, 2013 at 3:41 PM, <unituniverse.1@gmail.com> wrote:
> How about this:
> template < typename _Ty1 >
> class Outer
> {
> template < typename _Ty2 > class Inner;
> };
>
> // How to write Inner here?
>
I would guess something like:
template<typename T1, typename T2>
class Outer<T1>::Inner
{
};
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.
--089e013d14ca4004b804dc5fe7d5
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 Tue, May 7, 2013 at 3:41 PM, <span dir=3D"ltr"><<a href=3D"m=
ailto:unituniverse.1@gmail.com" target=3D"_blank">unituniverse.1@gmail.com<=
/a>></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"im">How about this:<div>templa=
te < typename _Ty1 ></div><div>class Outer</div><div>{</div><div>=A0 =
=A0 template < typename _Ty2 > class Inner;</div>
<div>};</div><div><br></div><div>// How to write Inner here?</div></div></b=
lockquote><div><br></div><div>I would guess something like:<br><br></div><d=
iv>template<typename T1, typename T2><br></div><div>class Outer<T1=
>::Inner<br>
{<br>};<br><br><br></div>Tony<br></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" 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 />
<br />
<br />
--089e013d14ca4004b804dc5fe7d5--
.
Author: Jens Maurer <Jens.Maurer@gmx.net>
Date: Sat, 11 May 2013 20:22:19 +0200
Raw View
On 05/10/2013 06:46 PM, Tony V E wrote:
>
>
>
> On Tue, May 7, 2013 at 3:41 PM, <unituniverse.1@gmail.com <mailto:unituniverse.1@gmail.com>> wrote:
>
> How about this:
> template < typename _Ty1 >
> class Outer
> {
> template < typename _Ty2 > class Inner;
> };
>
> // How to write Inner here?
>
>
> I would guess something like:
>
> template<typename T1, typename T2>
> class Outer<T1>::Inner
> {
> };
You can't merge the two template-parameter-lists.
See 14.5.2p1.
Jens
--
---
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.
.