-
December 21st, 2010, 06:35 PM
#1
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 ^ );
};
}
-
December 26th, 2010, 09:52 AM
#2
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.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|