Is it legal to replace something like this:
namespace foo {
namespace bar {
baz();
}
}
with something like this:
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!
}