Multiple namespace declaration in C++

You can combine namespaces into one name and use the new name (i.e. Foobar).

namespace Foo { namespace Bar {
    void some_func() {
        printf("Hello World.");
    }
}}

namespace Foobar = Foo::Bar;

int main()
{
    Foobar::some_func();
}

Pre C++17:

No, it's not. Instead of a bunch of indented nested namespaces, it's certainly valid to put them on the same line:

namespace Foo { namespace Bar { namespace YetAnother {
    // do something fancy
} } } // end Foo::Bar::YetAnother namespace

C++17 Update:

You can now nest namespaces more cleanly in C++17:

namespace Foo::Bar::YetAnother {
  // do something even fancier!
}