G
Guest
Hi again,
Maybe I missed something, but I cannot do a forward declaration in managed
C++.
By doing:
namespace Namespace
{
public __gc class A; // forward declaration
public __gc class B // B class, that uses A in constructor
{
public: B(A* a) : mA(a) {}
private A* mA;
};
public __gc class A // A class definition
{
....
};
}
Results in the following errors:
* warning C4677: 'B': signature of non-private function contains assembly
private type 'Namespace::A'
* see declaration of 'Namaspace::A'
* assembly access specifier modified from 'private'
A is clearly forward-declarated as public.
Any clue?
Thanks.
Maybe I missed something, but I cannot do a forward declaration in managed
C++.
By doing:
namespace Namespace
{
public __gc class A; // forward declaration
public __gc class B // B class, that uses A in constructor
{
public: B(A* a) : mA(a) {}
private A* mA;
};
public __gc class A // A class definition
{
....
};
}
Results in the following errors:
* warning C4677: 'B': signature of non-private function contains assembly
private type 'Namespace::A'
* see declaration of 'Namaspace::A'
* assembly access specifier modified from 'private'
A is clearly forward-declarated as public.
Any clue?
Thanks.