[webkit-dev] Using namespace std
darin at apple.com
Tue May 15 09:31:01 PDT 2012
On May 15, 2012, at 5:48 AM, Allan Sandfeld Jensen wrote:
> To me it seems like an odd practice, so I would like to ask what original rationale behind that style guideline is
Adding a list of using declarations like "using std::min" to the top of each source file would give us another ongoing maintenance job. The list in each file would grow, we’d not remember to remove them when they are no longer needed, and so on.
Adding "using namespace std" to the top of a source file deals with 99% of the issue without the trouble of maintaining another list at the top of each file.
When there is a conflict, there are typically many simple ways to resolve the conflict. Removing "using namespace std" entirely is not the only solution and we should avoid it if possible. I see in your patch in <https://bugs.webkit.org/show_bug.cgi?id=86465> that you have decided to remove it from many files, and before we do that I suggest we first investigate the other solutions.
Unfortunately your patch does not say what the conflict is; I can’t make a helpful suggestion for an alternate solution without that information.
More information about the webkit-dev