When you make the policy:
using namespace std; //primeira forma
You get direct access to all elements of the std namespace.
But suppose you want to use only std::cout
or std::endl
so it would be better to use the policy:
using std::cout; //segunda forma
using std::endl;
So you would only get the objects you need to use not all.
My question is: is there a way to view everything that is added when using the command using namespace std;
?
Something like (I know this is highly wrong):
#include <iostream>
using namespace std;
int main(){
cout << std;
return 0;
}
My question is in the following sense: I have read that it is preferable to use the second form of the mentioned using directive than to use the general form. The book explained that usually the first form adds things you do not use. So I wanted to know if there is a way to visualize these '' things ''. Anyway I already found the answer here link .