[webkit-dev] "using namespace" style guideline
darin at apple.com
Mon Nov 16 13:28:47 PST 2009
On Nov 15, 2009, at 9:57 PM, Chris Jerdonek wrote:
> In particular, the following file uses "using namespace WTF::Unicode" five times, but within the bodies of various template definitions:
> (see line 304, for example)
> Is this also not okay?
This is fine.
If the "using namespace" is scoped to a particular function, then it’s not the same thing we’re talking about.
> The following is another example. The using statement for this one appears at the beginning, outside of any definitions, but the file seems to be central:
> It uses "using namespace JSC".
> My second question is whether the guideline above should apply, for the same reason, to all "using" statements within header files -- and not just to "using namespace" statements. Statements of the form "using WTF::..." would be exceptions. You've already discussed those here:
> I checked, and there are only about 40 files in all of WebKit that wouldn't currently be following this -- slightly less than half of which are in JSC.
Probably. We’d have to discuss specific examples to be sure.
More information about the webkit-dev