Extract code of function

Andrey saasecondbox at yandex.ru
Sun May 26 17:46:35 UTC 2019


Hello,
Is it possible to extract code of some function into string 
variable using CT reflextion?
For example:
> int test(bool flag)
> {
>     return flag ? 100 : getRandom();
> }
>
> enum string code = GetFunctionCode!test; // "return flag ? 100 
> : getRandom();"


More information about the Digitalmars-d-learn mailing list