This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Two-stage name lookup problem
- From: "Brian T. Brunner" <brian dot t dot brunner at gai-tronics dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Wed, 26 Oct 2005 06:25:58 -0700
- Subject: Re: Two-stage name lookup problem
The a of type A contains a B, which includes another a of type A which in turn includes a B...
I can't imagine this not being an infinite recursion at the data object creation level.
If B contains a pointer to an object of type A, then we should be OK.
Brian Brunner
brian.t.brunner@gai-tronics.com
(610)796-5838
>>> John Love-Jensen <eljay@adobe.com> 10/26/05 08:47AM >>>
Hi Jakub,
Your problem is not with templates.
Here's your problem in a nutshell...
struct A
{
int x;
struct B
{
A a;
};
};
You cannot use A within B, because at that point A is incomplete.
You can pull B out of A. If you want B to be in the A namespace, change
'struct A' to 'namespace A', and make 'struct A_impl', fully declared, and
then use that within 'struct B'.
HTH,
--Eljay
*******************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept
for the presence of computer viruses.
www.hubbell.com - Hubbell Incorporated