Namespaces
Namespace Alias
Global Namespace
A ::
with nothing in front of it means starting at the global namespace.
Nested Namespaces
A child namespace has access to everything in its parent/ancestor namespaces.
Simplified basic C++ namespace rules are:
You can access anything in parent namespace path without specifying namespace.
You can access anything in child namespace path by specifying only relative path.
Everything else requires full namespace specifications.
"using" Keyword
Bring in a specific object from a different namespace, so you can refer to it directly.
Bring in an entire namespace.
Last updated