Is there any good reason why C++ namespaces are "closed" in D?

Walter Bright newshound2 at digitalmars.com
Mon Jul 30 20:08:53 UTC 2018


On 7/30/2018 1:05 PM, Walter Bright wrote:
> I'll look into this.

Check this:
---
   extern (C++, ns) { int foo(); }

   mixin template X() {  extern (C++, ns) int bar(); }
   mixin X!() x;
   alias bar = x.ns.bar;

   void main() {
     foo();
     bar();

     pragma(msg, foo.mangleof);
     pragma(msg, bar.mangleof);
   }
---

   dmd -c test
   ?foo at ns@@YAHXZ
   ?bar at ns@@YAHXZ


More information about the Digitalmars-d mailing list