Hi
I would like to create a proposal to simplify class forward declarations using namespaces.
Before I invest time into the proposal, I did like to know if this kind of proposal was already discussed and/or rejected. My internet search did not got any result, but this may be just the case because I did not found the right keywords for my search.
My core proposal is actually quite simple. If one is using libraries and namespaces, a forward declaration of a class in a namespace is a common thing
namespace ex {
class Foo;
class Bar;
}
class Example {
ex::Foo *_foo;
ex::Bar *_bar;
};
With nested namespace, this code gets worse:
namespace ex {
namespace foo {
class Foo;
}
namespace bar {
class Bar;
}
}
class Example {
ex::foo::Foo *_foo;
ex::bar::Bar *_bar;
};
If namespaces in forward declarations would be allowed, it would simplify the code:
class ::ex::foo::Foo;
class ::ex::bar::Bar;
class Example {
ex::foo::Foo *_foo;
ex::bar::Bar *_bar;
};
Was this feature ever discussed? Was it rejected, and why?
All the best,
LR