Several times in my code I write something like
// all these using
using this::is::a::very::long::name::space::var1;
using this::is::a::very::long::name::space::var2;
using this::is::a::very::long::name::space::var3;
using this::is::a::very::long::name::space::fun1;
using this::is::a::very::long::name::space::fun2;
// to make this line cleaner
fun1(var1,fun2(var2,var3));
because I don't want to make any name from that namespace available, other then the 5 names I've listed.
Does C++ offer anything to use all those names without having to write the common part of the scope over and over?
using
declarations in the same way that python has afrom package import x, y, z
. C++ has no such facility, but this doesn't really make the question a duplicate of "What is a namespace alias" – Human-Compiler Sep 14 '20 at 14:32USING(this::is::a::very::long::name::space, var1, var2, var3, fun1, fun2)
... but I thought the "cure" was worse than the problem it was trying to solve (because I hate macros). – Eljay Sep 14 '20 at 15:20