Suppose I have a pair of nested namespaces like these:
namespace A
{
namespace B
{
int foo = 0;
}
}
If B
was a class, I could write using A::B
to avoid typing A::
every time. I attempted to do the same thing with B
as a namespace, but the compiler informed me that this was not allowed.
If I were to write using namespace A::B
, this would introuduce everything contained in B
into the local namespace. I could write using namespace A
, which would produce the desired results (writing B::foo
), but this would come with everything else in A
.
Is it possible to bring B
into the local namespace without everything else in A
?