Using Namespaces
Namespaces have to be written exactly as they are, however, the 'using' method allows us to make namespaces simpler.
We'll cover the following...
If you use qualified names, you have to use them exactly as defined. For each namespace you must put the scope resolution operator ::
. More libraries of the C++ standard library use nested namespaces.
Press + to interact
#include <iostream>#include <chrono>...std::cout << "Hello world:" << std::endl;auto timeNow= std::chrono::system_clock::now();
Unqualified Use of Names
You can use names in C++ with the using
declaration and the using
directive.
Using Declaration
A using
declaration adds a name to the visibility scope, in which you applied the using
...