Extract code of function

Jacob Carlborg doob at me.com
Sun May 26 18:14:23 UTC 2019


On 2019-05-26 19:46, Andrey wrote:
> 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();"

No, that's not possible.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list