trait to get the body code of a function?
rikki at cattermole.co.nz
Tue Jul 24 05:27:36 UTC 2018
On 24/07/2018 4:43 PM, Guillaume Lathoud wrote:
> __traits and std.traits already offer access to function information
> like input parameters, e.g. in std.traits: ParameterIdentifierTuple
> Even if that might sound strange, is there a compile time access to the
> body of the function, e.g. as a code string, or at least to the filename
> where it was declared?
> I have not found a direct "string" access, but I found these:
> ...and I am not sure how to proceed from here to get the code as a
> string that declared the function. Context: I have some compile-time
> ideas in mind (code transformation).
> Best regards,
> Guillaume Lathoud
More information about the Digitalmars-d-learn