On Thursday, 19 March 2020 at 04:30:32 UTC, Calvin P wrote:
I use this code to get member function address on runtime:

=========
struct A {
       this(){};
}
auto ctor = (&__traits(getMember, A.init,"__ctor")).funcptr;
=========


my question is, how to get it in compile time like static function address

You asked the same question two days ago.
Check the reply.
https://forum.dlang.org/post/r4ohd3$2e94$1...@digitalmars.com

You can assemble a delegate with an struct pointer or class reference and a function member pointer.

Reply via email to