I have a property that accepts a delegate: http.onReceiveHeader = (in char\[\] key, in char\[\] value) { }. I want to use a separed function instead of, e.g:
void do_something(char[] key, char[] value)
{
}
http.onReceiveHeader = do_something;
it's possible do it in D?
There is a toDelegate function in std.functional.
So this should work:
http.onReceiveHeader = toDelegate(do_something);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With