Consider this situation:
struct Foo
{
struct Bar
{
};
};
How do I forward-declare Foo::Bar
?
What I tried:
struct Foo::Bar;
error: 'Foo' has not been declared
struct Foo;
struct Foo::Bar;
error: 'Bar' in 'struct Foo' does not name a type
namespace Foo
{
struct Bar;
}
// ...
struct Foo
{
struct Bar
{
};
};
error: 'struct Foo' redeclared as different kind of symbol
struct Foo
{
struct Bar;
};
// ...
struct Foo
{
struct Bar
{
};
};
error: redefinition of 'struct Foo'