On 2014-04-05 20:47:32 +0000, Walter Bright <newshou...@digitalmars.com> said:

Yes, this seems to be a fatal flaw. Another design that has evolved from these discussions and my discussions with Andrei on it:

     extern (C++, namespace = A.B) { void foo(); void bar(); }
     extern (C++, namespace = C) void foo();

     bar();  // works
     A.B.bar(); // works
     foo(); // error: ambiguous
     C.foo();   // works

     alias C.foo foo;
     foo();  // works, calling C.foo()

What if you also have a C++ foo at global scope?

        module cpptest;

        extern (C++) void foo();
        extern (C++, namespace = A) void foo();

        foo(); // ambiguous
        A.foo(); // works
        .foo(); // works?
        cpptest.foo(); // works?

Does these two last lines make sense?


--
Michel Fortin
michel.for...@michelf.ca
http://michelf.ca

Reply via email to