C++ Newsletter/Tutorial Issue 18
@eZine
Published in
CPPNL
· 2 years ago
... functions are found within namespaces. The three basic ways of making the contents of a namespace visible were discussed in C++ Newsletters #002 and #004. These are: explicit qualification, using directives, and using declarations. Consider the following namespace, which declares a class and some (non-member) functions: namespace N { class A { ... }; A& operator+(const A&, const A&); void f(A); void g(); } Now consider the following function that takes arguments of the class type: void z(N::A x, N::A y) { x + y; // (1) f(x); // (2) g(); // (3) } Given the original rules for namespaces (just the three basic meth ...