[webkit-dev] Using namespace std

Allan Sandfeld Jensen kde at carewolf.com
Tue May 15 05:48:07 PDT 2012


Hello webkit-dev

I would like to bring up an issue in the style guide that I have run into and 
find a little odd.

In my recent patch to compile WebKit using C++11 and GCC, I had to resolve a 
name conflict between global and std namespace. To do this you have to avoid 
expanding the full std namespace, that is avoiding the call 'using namespace 
std'. Unfortunately it seems the WebKit style guide and style-checking script 
requires that call instead of more precise and safe calls such as 'using 
std::'.

The bug in question is https://bugs.webkit.org/show_bug.cgi?id=86465 and the 
same problem has been encountered before in 
https://bugs.webkit.org/show_bug.cgi?id=59249

The issue is not about these specific bugs though. First of all I do 
understand the rationale behind the rule to always expand the full 'std' 
namespace. To me it seems like an odd practice, so I would like to ask what  
original rationale behind that style guideline is, and if it would be 
acceptable to drop that rule?

Best regards.
`Allan


More information about the webkit-dev mailing list