How to forward declare nested managed class in C++/clr
OK, for the life of me, I can't find this answer. How can I forward declare a nested managed class? Here is an example of what I'm trying to accomplish:
Code:
namespace Geometry
{
ref class Vectors;
ref class Points;
// ref class Points::Point2; <-- won't compile but this is the idea...
public ref class Vectors
{
public:
ref class Vector2
{
};
void SomeFunc( Points::Point2 ^ ); // <===== C2027
};
public ref class Points
{
public:
ref class Point2
{
};
void SomeFunc( Vectors::Vector2 ^ );
};
}
Re: How to forward declare nested managed class in C++/clr
This is common C++ restriction, not only C++/CLI: You can only give a forward declaration of a nested class within the outer class declaration.