Lecture overview -- Keyboard shortcut: 'u'  Previous page: Logical program organization -- Keyboard shortcut: 'p'  Next page: Physical program organization -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 2 - Page 38 : 42
Notes about C++
Basic facilities
More namespaces

Oher namespace characteristics

  • A namespace is open

    • A single namespace N can span several source files

    • For instance namespace N {...} forms in two or more header files

  • Namespaces can be nested

  • There is a global namespace

    • Access to name in the global namespace:     ::name

  • Unnamed namespaces

    • Used in C++ to make names local to a compilation unit

  • The C++ Programming Language: Page 177, 200 - Unnamed namespaces
 

y:/Kurt/Files/Advanced-programming-cpp/cpp/kn/namespaces/namespace-2.ccIllustrating that a namespace interface is separated from the namespace implementation.


The syntactic namespace form is intended for declarations, not full definitions

This separates the namespace interface from the namespace implementation

In the same way as for classes