Are interfaces supported in Better C mode?

kinke noone at nowhere.com
Sun Nov 15 01:00:27 UTC 2020


On Saturday, 14 November 2020 at 21:46:38 UTC, Dibyendu Majumdar 
wrote:
> Well this compiles but doesn't link.

This works with LDC:

import core.stdc.stdio : printf;

extern (C++) interface A {
     void sayHello();
}

extern (C++) class B : A {
     void sayHello() {
         printf("hello\n");
     }
}

extern (C) void main() {
     scope b = new B;
     b.sayHello();
}


More information about the Digitalmars-d mailing list