Specifying C++ symbols in C++ namespaces

Walter Bright newshound2 at digitalmars.com
Sat Apr 5 19:33:42 PDT 2014


On 4/5/2014 6:26 PM, Michel Fortin wrote:
> What if you also have a C++ foo at global scope?

It'll work exactly the same as import does.


>      module cpptest;
>
>      extern (C++) void foo();
>      extern (C++, namespace = A) void foo();
>
>      foo(); // ambiguous
>      A.foo(); // works
>      .foo(); // works?

Yes.

>      cpptest.foo(); // works?

Yes.

> Does these two last lines make sense?

Just as much sense as:

     module bar;
     void foo();
     .foo(); // works
     bar.foo(); // works

Namespace lookup rules would be exactly the same as for imports and mixin templates.


More information about the Digitalmars-d mailing list