<div dir="ltr">Is there a way to do this?<div><br></div><div><div>import std.algorithm;</div><div><br></div><div>auto fun(T)(T a){return a;}</div><div><br></div><div>template fun2(T){auto fun2(T a){return fun(a);}}//OK but heavy syntax and cannot be nested inside test()</div>
<div><br></div><div>void main(){</div><div> //alias fun2=fun!int; //OK but needs to specify template params</div><div> //none of those work:</div><div> //alias fun2=a=>fun(a);</div><div> //alias fun2(T)=(T a)=>fun(a);</div>
<div> //alias fun2(T)=(T a){return fun(a);}</div><div> auto b=[1].map!fun2;</div><div> assert(b.equal([1]));</div><div>}</div><div><br></div></div></div>