On Friday, 14 October 2022 at 18:34:58 UTC, kdevel wrote:
dmd and gdc optimize the lambda invocations away. Nonetheless the expression looks somewhat too big. To overcome this I tried to generate the function pointer outside of the struct:``` auto funcptr (alias method) () { return &method; } : fun = funcptr!bar; : ```Which works but neither dmd nor gdc were able to optimize the additional function call away.
pragma(inline, true) auto funcptr (alias method) ()