70,004
社区成员




namespace B {
int b;
}
namespace A {
using namespace B;
int a;
}
namespace B {
using namespace A;
}
void f()
{
A::a++; //OK: a declared directly in A, S is { A::a }
B::a++; //OK: both A and B searched (once), S is { A::a }
A::b++; //OK: both A and B searched (once), S is { B::b }
B::b++; //OK: b declared directly in B, S is { B::b }
}
namespace A {
struct x { };
int x;
int y;
}
namespace B {
struct y {};
}
namespace C {
using namespace A;
using namespace B;
int i = C::x; // OK, A::x (of type int)
int j = C::y; // ambiguous, A::y or B::y
}