On 3/5/20 9:24 AM, wjoe wrote:
but how can I call fn in the context of an object instance?
You could do it with delegates. But it's ugly: import std.stdio; class C { void foo() { writeln("Yup");} } void main() { alias f = C.foo; auto c = new C; void delegate() dg; dg.funcptr = &f; dg.ptr = cast(void*)c; dg(); // prints "Yup" } I don't know of a way to call f with c aside from this. -Steve