import std.stdio;
extern(C++) class A
{
~this(){}
int i;
}
extern(C++) interface I
{
void f();
}
extern(C++) class B : A, I
{
void f()
{
writeln("B.f ", i);
}
}
void main()
{
scope obj = new B;
obj.i = 42;
obj.f(); // Prints 42 as expected
auto dg = &obj.f;
dg(); // Crashes on Windows
}
The above program works on Linux, but crashes on Windows while calling dg.
The above program works on Linux, but crashes on Windows while calling
dg.