On Monday, 3 October 2016 at 03:50:29 UTC, Jacob wrote:
import std.stdio;struct SomeStruct { int value; void func() { writeln(value); } } void main() { SomeStruct someStruct; someStruct.value = 333;auto func = cast(void function(ref SomeStruct))&SomeStruct.func;func(someStruct); } Has worked so far for me.
But it can be useful to take the address of the code and to patch the "this" pointer of a delegate later. Used several times.
What's the plan ? to disable this ! Plz no.