toDelegate() for D1

Simen kjaeraas simen.kjaras at gmail.com
Wed Jan 12 09:07:21 PST 2011


%u <e at ee.com> wrote:

> I only need something to make a void deleg() from a void func().

This works for me:

ReturnType!( F ) delegate( ParameterTypeTuple!( F ) ) toDelegate( F )( F  
fn ) {
     return ( ParameterTypeTuple!( F ) args ){ return fn( args ); };
}

-- 
Simen


More information about the Digitalmars-d-learn mailing list