D compiler equivilent of "gcc -E" for debug/view template instantiation(generated) code?

WebFreak001 d.forum at webfreak.org
Fri Jul 30 06:46:18 UTC 2021


On Friday, 30 July 2021 at 06:00:41 UTC, dangbinghoo wrote:
> hi, is there any D compiler option or other method to view the 
> final template instantiation but not compiled (in asm or 
> binary) code?
>
> if there's a way, it might be very usefull for newbies like me 
> to learn and understand the the Meta programming of dlang.
>
>
>
> thanks!
>
> dbh

Not sure if this is exactly what you want but there is a hidden 
switch in dmd called `-vcg-ast` that prints out all the templates 
instantiated.

On run.dlang.io you can use the "AST" button to view this 
conveniently online.


More information about the Digitalmars-d-learn mailing list