Delegates and C function pointers

Nicolas Sicard via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Nov 8 04:23:43 PST 2014


I would like to register a D delegate to a C API that takes a
function pointer as a callback and a void* pointer to pass data
to this callback.

My solution is in http://dpaste.dzfl.pl/7d9b504b4b965.

Is this code correct? Is there something simpler or already in
Phobos that I have overlooked?

Thanks
-- Nicolas


More information about the Digitalmars-d-learn mailing list