[Issue 16365] cannot allow calling function pointer from delegate in @safe code

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 8 03:07:58 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16365

--- Comment #1 from ag0aep6g at gmail.com ---
(In reply to ag0aep6g from comment #0)
>     S s;
>     void delegate(immutable int*, int*) @safe d = &s.f1;
>     void function(immutable int*, int*) @safe f = d.funcptr; /* uh-oh */

Can also use `f = &S.f1;` to obtain the unsafe function pointer.

--


More information about the Digitalmars-d-bugs mailing list