> On Aug 29, 2017, at 9:04 AM, Chris Dumez <cdu...@apple.com> wrote:
> 
> I indeed think this will require “using” statements or explicit namespace at 
> call sites.

Yeah, this is basically what’s required. Unfortunately, if you ‘using 
namespace’ in a namespace all subsequent copies of that namespace will also see 
the ‘using’. e.g.

namespace Foo {
namespace Bar {
    int myVar { 0 };
}
using namespace Bar;
}

namespace Foo {
namespace Baz {
    int myVar { 0 };
}
using namespace Baz;

int myFunction() { return myVar; }
}

Will fail since myVar could be Baz::myVar or Bar::myVar. Using ‘using 
namespace’ inside a function or class body should be fine however.

> 
> I don’t think anonymous namespaces are suitable for resolving naming 
> conflicts due to unity builds since the functions and up in the same 
> compilation unit.

That’s right.

> 
> --
>  Chris Dumez
> 
> 
> 
> 
>> On Aug 29, 2017, at 9:00 AM, Darin Adler <da...@apple.com 
>> <mailto:da...@apple.com>> wrote:
>> 
>> How does this work? Without a “using” how does it know to search this 
>> namespace? Is this superior to using anonymous namespaces instead of 
>> “static”?
>> 
>> — Darin
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev@lists.webkit.org <mailto:webkit-dev@lists.webkit.org>
>> https://lists.webkit.org/mailman/listinfo/webkit-dev
> 

_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to