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));
}

Can you point me at some documentation that explains this behavior?


Reply via email to