auto add(T)(T a,T b) { return to!RetureType(a+b); } void fun(T)(T x) { } fun!double(add(1,2)); fun!int(add(1,2)); just add a implicit RetureType,not need visible,background syntax tree like this auto add(RetureType,T)(T a,T b) but we can see ,the type reduce logical changed from down-up to up-down template SelectFrom(T) { alias SelectFrom=T; } auto add(T=SelectFrom!(ReturnType))(T a,T b) these will change the language' template more magic when mix use with opCast,opDispacth...act
No, D does not support such features because the return type is always deduced from the function body, not from the surrounding context (there are some exceptions with regards to lambda functions). This is a major change that does really bring too much benefit.