toDg

Helper function to wrap any callable type in a delegate. Most useful when you need to pass function pointer as a delegate argument.

This function allocates a closure class for a delegate.

NB! toDg does not preserve any argument attributes of Func such as ref or lazy.

ReturnTypeOf!(Func) delegate
()
toDg
(
Func
)
(
Func f
)

Parameters

f Func

function or function pointer or delegate

Return Value

Type: ReturnTypeOf!(Func) delegate
(
ParametersOf!(Func)
)

delegate that internally calls f and does nothing else

Meta