D requires a this context for non-static member functions, so you can’t get a raw function pointer at compile time inside a member without a helper. Your enum fnptr!foo = &fn workaround is the cleanest solution.