C++ Language/Namespace/NamedAndUnnamed

From Wikibooks, open books for an open world
Jump to navigation Jump to search

An unnamed namespace {...} is a way to restrict the visibility of a global variable to one single file.

If you dislike the name that somebody gave to a namespace, namespace NRNew = NROld; creates your own alias for it.

Additional information about unnamed namespaces (includes interactive examples)