On Thursday, 19 March 2020 at 04:30:32 UTC, Calvin P wrote:
my question is, how to get it in compile time like static function address:

=========
struct A {
     void d(){};
     static void fn(){};
}

enum FN = &A.fn;  // static method address is ok
enum A1 = (&__traits(getMember, A,"d")).funcptr; // Error: no property funcptr for type void function()

Check the error message there... you already have a function pointer, no need to use the .funcptr metod.

It is a bit weird though because it actually EXCLUDES the hidden argument for `this`. I prefer doing wrapper functions usually.

Reply via email to