Is there an C++ equivalent to Python's "import bigname as b"?

alias, c++, namespaces, python

Solution

namespace bhn = big_honkin_name;

There's another way to use namespaces too:

using big_honkin_name::fn;
int a = fn(27);

Problem

I've always liked Python's ``` import big_honkin_name as bhn ``` so you can then just use `bhn.thing` rather than the considerably more verbose `big_honkin_name.thing` in your source. I've seen two type of namespace use in C++ code, either: ``` using namespace big_honkin_name; // includes fn(). int a = fn (27); ``` (which I'm assured is a bad thing) or: ``` int a = big_honkin_name::fn (27); ``` Is there a way to get Python functionality in C++ code, something like: ``` alias namespace big_honkin_name as bhn; int a = bhn::fn (27); ```

Original source

Related problems