Quote Originally Posted by swappo
I was recently told that I should use std:: in my header files as opposed to using namespace std but I don't really know why.
You should avoid namespace level using directives (e.g., using namespace std) and using declarations in header files (e.g., using std::cout). The reasons have been outlined by legit and Salem. However, note that this is not necessarily the case for a more restricted scope, e.g., the use of the using declaration to bring in names from a base class that would otherwise be hidden, or in the definition of an inline function.

Quote Originally Posted by legit
If you use the namespace std, and want to declare an object of your class, the compiler will get confused and most likely spit out an error:
Quote Originally Posted by Salem
And there's no way to undo the damage, so they have to come to you to edit the code.
Note that you can still fully qualify the names even when using directives and using declarations are in effect... but if you do not do this when you should, it could be possible for your code to compile and be mysteriously incorrect.