On 7/30/2018 7:20 AM, Atila Neves wrote:
------
extern (C++, ns) { int foo() { return 1; } }

mixin template X()
{
  extern (C++, ns) { int bar() { return 2; } }
}

mixin X!() x;

-------

void main() {
     pragma(msg, __traits(allMembers, ns));
     foo;
     bar;
}

$ dmd foo.d
tuple("foo")
foo.d(15): Error: undefined identifier bar

That method doesn't compile.

You'll need to add:

    alias bar = x.bar;

which will add bar to the current scope.


foo.o:foo.d:function _Dmain: error: undefined reference to 'S::ns::bar()'

Hmm, when I tested it the 'S::' prefix wasn't there. But when I retested it, it was. (!) I'll look into this.

Reply via email to