Quote Originally Posted by 2kaud View Post
I agree that you don't put 'using ...' in any header file. However, unless you are using multiple namespaces...
So, what do you do when you introduce, say, a boost library to a cpp file that you created before? Do you remove "using namespace std;" and spend maybe 10 minutes to fix all the compiler errors? Doesn't seem like a good idea to use a coding style that is so fragile to changes.

The problem I meant with using header files is when you have class definitions or function declarations in a header file and the implementation in a cpp file. If the (member) functions have arguments or a return value that is a class in the std namespace, then the signature will look different in the header file and the cpp file. E.g. in the header file you have
Code:
std::string MyFunction(const std::vector<int>& v);

// and in the cpp file you have

string MyFunction(const vector<int>& v) {
    //...
}
If instead you don't use the "using namespace" stuff (at least, not at global scope), then the two are the same and you can just copy-paste.