usingnamespace std
Pro: You would never have to type 'std::' in that file
Con: If you are using other libraries and using other namespaces, you will lose the benefits from having namespaces and every symbol would be in the global one. std::xxx
Pro: You don't have ambiguities from which library/namespace the symbol comes from
Con: You have to type more using std::xxx
Pros: You won't have to type std:: in front of 'xxx', the global namespace doesn't get filled of stuff you don't need
Con: You need a line for each symbol you are using.
My suggestion:
If you are sure that you won't use other libraries you can just usingnamespace std
In header files always type std::
In other situations, when you need to use frequently a symbol from the std namespace add using std:: ... ;
I agree with Bazzy. using std::string, for example, is something I usually use because otherwise, to use strings or even string functions you need to prepend std::, like this: std::string::, and that just seems a waste of time.