www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Issue 8184 - problem with tuple argument deduction

this work

class Bind(alias indeces)
{
     static if(is(typeof(indeces) : int[]))
     {
         static auto opCall(D,V...)(D dg,V values)
         {
             static if(is(D d : R delegate(U), R, U...) &&
                       is(V == 
Combination!(indeces,ParameterTypeTuple!D)))
             {
                 static if(indeces.length > 1)
                     return
Bind!(update!(indeces,indeces[0])[1..$])(Curry!(indeces[0])(dg,values[0]),values[1..$]);
                 else
                     return Curry!(indeces[0])(dg,values[0]);
             }
         }
     }
}

while this doesn't work

class Bind(alias indeces)
{
     static if(is(typeof(indeces) : int[]))
     {
         static auto opCall(R,U...)(R delegate(U) 
dg,Combination!(U) values)
         {
                 static if(indeces.length > 1)
                     return
Bind!(update!(indeces,indeces[0])[1..$])(Curry!(indeces[0])(dg,values[0]),values[1..$]);
                 else
                     return Curry!(indeces[0])(dg,values[0]);
         }
     }
}
Jun 10 2012