template instantiation --- having trouble therewith

Carl Sturtivant sturtivant at gmail.com
Wed Sep 4 16:23:47 PDT 2013


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?




More information about the Digitalmars-d-learn mailing list