Is there a construct similar to using namespace that does not make imported characters visible outside the body (or bodies) of the namespace?
In this example, each character in whatever and other_namespace will also be accessible through Foo::<name_of_symbol> ... and I would like to prevent this.
namespace Foo { using namespace whatever; using namespace other_namespace;
As a complete example, this program is valid. If there were an alternative using namespace with supposed semantics, it would not be.
namespace a { int func(int x) { return 10; } } namespace b { using namespace a; } namespace c { int do_thing(int x) { return b::func(57); } }
source share