namespace A { int x = 1; int z = 2; } namespace B { int y = 3; int z = 4; } void doSomethingWith(int i) throw(); void sample() throw() { using namespace A; <-- 1 using namespace B; <-- 2 doSomethingWith( x ); <-- 3 doSomethingWith( y ); <-- 4 doSomethingWith( A::z ); <-- 5 doSomethingWith( B::z ); <-- 6 #ifdef GENERATE_ERROR doSomethingWith( z ); <-- 7 #endif } main() { sample(); }
|