Issue with typeof

StarGrazer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 20 09:55:38 PDT 2017


typeof(&method) fails unless method is static. Says & requires 
this.

But for typeof, it shouldn't matter and should pass.

So how to get a function pointer to a non static member 
function(of an interface)?

I've tried creating the type like

T t;
typeof(&t.method) fptr;

but same issue. It may be because T is an interface, but again, 
it shouldn't matter. I just want the function pointer declaration.

e.g., `void function();` for `void foo();`


This is to avoid building the declaration myself which may be 
error prone.



More information about the Digitalmars-d-learn mailing list