On Tuesday, 3 September 2013 at 17:25:12 UTC, Manfred Nowak wrote:
Carl Sturtivant wrote:
Writing muddle!(int,int)
[...]
gives the same error message.
Not entirely true:
template muddle( T, U...){
alias T delegate( U) Dptr;
auto muddle1( T, U...)( Dptr f) {
return f; //or make another delegate in real code
}
alias muddle1!( T, U) muddle;
}
unittest {
import std.stdio;
int x = 3;
int scale( int s) { return x * s; }
auto f= muddle!( int, int)( &scale);
writeln( f(7));
}
-manfred
This technique does what I want if there's a single parameter to
the delegate. I'll explore from here; thanks for all the examples.
Carl.