 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
fa Guest
|
Posted: Mon Jul 28, 2003 4:55 pm Post subject: forward declaration |
|
|
hi all,
following the standard what is allowed in forward declarations
beetween:
1) class a_class; //forward declaration
class another_class
{
a_class object;
};
2) class a_class
class another_class
{
a_class* object
}
3) class a_class; //forward declaration
class another_class : public a_class
{
};
it seems on my compiler that just the 2nd one does compile.
more, what the standard says about the standard library? at my
knolewdge with members of the standard librery forward declarations
are not permitted, isn'it?
thanks
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
Richard Smith Guest
|
Posted: Mon Jul 28, 2003 7:08 pm Post subject: Re: forward declaration |
|
|
fa wrote:
| Quote: | 1) class a_class; //forward declaration
class another_class
{
a_class object;
};
|
This is not legal. All members must be complete.
| Quote: | 2) class a_class
class another_class
{
a_class* object
}
|
This is perfectly OK.
| Quote: | 3) class a_class; //forward declaration
class another_class : public a_class
{
};
|
Again, this is not legal. Base classes must also be
complete.
| Quote: | what the standard says about the standard library? at my
knolewdge with members of the standard librery forward declarations
are not permitted, isn'it?
|
I'm not sure I understand the question. If you're asking
whether you are allowed to forward declare classes that are
defined in the standard library, then the answer is no.
--
Richard Smith
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|