Is this behavior right?
Yes, this is the correct behavior and is well defined according to the C ++ standard.
The relevant section of Β§ 7.3.3.11 of the C ++ 11 standard:
, -, , -. , -, .
[ Example:
namespace A {
void f(int);
}
using A::f;
namespace A {
void f(char);
}
void foo() {
f(βaβ);
}
void bar() {
using A::f;
f(βaβ);
}
βend example ]