<div dir="ltr"><div>Is there any way to get the enclosing function as symbol ?</div><div><br></div>I'd like something like that:<div>alternative names would be:</div><div><div><div>__function__</div><div></div></div></div>
<div><div><div>__context__</div></div><div><div><br></div></div><div></div></div><div>----</div><div>auto fun(alias caller=__function__)(){</div><div>  //caller represents fun1!double</div><div>  return ReturnType!caller.init;<br>
</div><div>}</div><div><br></div><div>T fun1(T)(T x){</div><div>  assert(__function__.stringof==__FUNCTION__);</div><div>  alias fun=__function__;</div><div>  assert( is(ReturnType! __function__) == T);</div><div>  return fun();</div>
<div>}<br></div><div>void main(){fun1!double();}</div><div><div>----</div></div><div><br></div></div>