Specifying C++ symbols in C++ namespaces

Walter Bright newshound2 at digitalmars.com
Fri Apr 4 12:43:56 PDT 2014


On 4/4/2014 5:34 AM, Dicebot wrote:
> Late to the thread, my short opinion:
>
> extern(C++ namespace::path) looks best. It should only affect mangling and have
> no impact on fully qualified name on D side. Most KISS solution I have read in
> the thread.

Fails because:

C++:

     namespace S { namespace T {
         int foo();
         namespace U {
             int foo();
         }
      } }

D:

   extern (C++, S::T) {
       int foo();
       extern (C++, U) {
         int foo();
       }
   }
   foo();  // error, ambiguous, which one?
   S.T.foo(); // S undefined




More information about the Digitalmars-d mailing list