Using Namespace: // My Second Program in C++
Using Namespace: // My Second Program in C++
In order to refer to the elements in the std namespace a program shall either qualify each and
every use of elements of the library (as we have done by prefixing cout with std::), or introduce
visibility of its components. The most typical way to introduce visibility of these components is by
means of using declarations:
Both ways of accessing the elements of the std namespace (explicit qualification
and using declarations) are valid in C++ and produce the exact same behavior. For simplicity, and
to improve readability, the examples in these tutorials will more often use this latter approach
with using declarations, although note that explicit qualification is the only way to guarantee that
name collisions never happen.