D
Dave Rudolf
Hey all,
I have a philosophical question for you folks -- that is, I don't really
need an immediate solution, but rather I am just curious.
Is there some way to make forward declarations for internal classes. The
situlation that I have is probably best illustrated with some code:
// legal forward declaration
class B;
// illegal forward declaration
// class B::Bi;
class A
{
B _b;
// B::Bi _bi;
};
class B
{
class Bi
{
};
A _a;
};
Let's forget that the above code is probably not the best design. Now, if I
want class A to handle references to class B, I can do the normal forward
declaration thing before class A, as above. But what if I want to reference
B's inner class, as suggested by the commented-out code? Is there any way to
do such a thing?
Of course, the work-around could be to move the inner class into it's own
class. Like I said, I'm just curious.
Dave
I have a philosophical question for you folks -- that is, I don't really
need an immediate solution, but rather I am just curious.
Is there some way to make forward declarations for internal classes. The
situlation that I have is probably best illustrated with some code:
// legal forward declaration
class B;
// illegal forward declaration
// class B::Bi;
class A
{
B _b;
// B::Bi _bi;
};
class B
{
class Bi
{
};
A _a;
};
Let's forget that the above code is probably not the best design. Now, if I
want class A to handle references to class B, I can do the normal forward
declaration thing before class A, as above. But what if I want to reference
B's inner class, as suggested by the commented-out code? Is there any way to
do such a thing?
Of course, the work-around could be to move the inner class into it's own
class. Like I said, I'm just curious.
Dave