Muhammed said:
hmm.thank you.. sorry that i am not very convinced.
still
namespace A {class AA {};}
namespace B {typedef A::AA AA;} /doesnt give error here
namespace C {using namespace A; using namesace B} // no error
but if say C::AA compiler barks. I am really confused with these
behaviours.
Why do you expect an error? The using directive says: iff you search for
a type, consider all types in this namespace too. Not more. So the
following code is legal:
namespace A {class AA {};}
namespace B {typedef A::AA AA;} //doesnt give error here
namespace C {using namespace A; using namespace B; A::AA a; B::AA b; }
// no error
But what AA should be used if you say C::AA?
You could use
namespace A {class AA {};}
namespace B {typedef A::AA AA;} //doesnt give error here
namespace C {using namespace A; using namespace B; typedef A::AA AA; }
// no error
C::AA x;
Lars