Reputation: 2851
I have a tough time wording this question but here's my code to start:
namespace UserInterface
{
class UiClass
{
};
}
namespace Project
{
namespace UserInterface
{
}
}
namespace Project
{
UserInterface::UiClass uiClass;
}
So that code won't work because a UserInterface
is a global namespace but it's also inside Project
so when I instaniate UiClass
inside Project
it tries to look inside Project->UserInterface
instead of just UserInterface
. Is there a some way to be specific that I want to use the global UserInterface
and not the one inside Project
or do I need to change my design?
Upvotes: 2
Views: 125
Reputation: 119219
You can force the name lookup to begin at the global scope using a leading ::
.
::UserInterface::UiClass uiClass;
Upvotes: 8