www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13771] New: any language support capture acquire type?


          Issue ID: 13771
           Summary: any language support capture acquire type?
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: galaxylang gmail.com

auto add(T)(T a,T b)
    return to!RetureType(a+b);

void fun(T)(T x)


just add a implicit RetureType,not need visible,background syntax tree like

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

Nov 24 2014