extern(C++, NS)

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 30 02:12:54 PST 2015


On Sunday, 29 November 2015 at 04:57:28 UTC, Walter Bright wrote:
> We considered making them for mangling only, and rejected it as 
> unworkable, because then two identical names in different 
> namespaces could not be distinguished by the D symbol table 
> system.

Didn't you show how two identical names can be distinguished with 
D symbol table system:

On Sunday, 29 November 2015 at 18:29:14 UTC, Walter Bright wrote:
>     file1.NS.X x;
>     file2.NS.Y y;

It also works the same for C bindings: they share (empty) 
namespace, but identical C declarations can be distinguished in D 
if they are in different modules. Maybe it's better to ignore C 
namespaces and rely on D module system instead?
Though I don't know why one would want to disallow access to a 
C++ namespace.


More information about the Digitalmars-d mailing list