Combining Delegate and Functions

Jason House jason.james.house at gmail.com
Tue Jun 30 20:10:09 PDT 2009


Eric Poggel Wrote:
> I don't have D2 installed, but the above fails to compile in d1 
> (non-constant expression __dgliteral1).  


Here's the code I use in D2:

R delegate(T) toDelegate(R, T...)(R function(T) f){
   return delegate R(T t){return f(t);};
}



More information about the Digitalmars-d mailing list