5 ms·
I seem to remember having used some GCC options to look at the expanded templates years ago, but I’m not certain about the details and my impression was that it
by AlbertoGP 4y ago
I seem to remember having used some GCC options to look at the expanded templates years ago, but I’m not certain about the details and my impression was that it did not help much.
Trying to verify that I found this tool called Templator that apparently does it in a nice graphical way:
https://www.cevelop.com/#templator https://www.cevelop.com/#templator
The license is restrictive but you can download it for free:
https://www.cevelop.com/license/ https://www.cevelop.com/license/
- sargstuff 4y agoclang+ & g++ options for asm & psuedo c/c++ : https://stackoverflow.com/questions/4448094/can-we-see-the-template-instantiated-code-by-c-compiler https://stackoverflow.com/questions/4448094/can-we-see-the-t...
- sargstuff 4y agoCompiler Explorer shows template, expanded template & equivalent assembler. https://godbolt.org/ https://godbolt.org/
- sargstuff 4y agoUntested / unverified approaches: Seems thee's an emacs "expand the C++ template" concept: demystifycpp https://github.com/chriskmanx/demystifycpp https://github.com/chriskmanx/demystifycpp etbrain's ide package(s) support gcc cpp directives, so in theory should be able to expand a c++ template in cpp fashion in similar manner as regular code blocks. https://www.jetbrains.com https://www.jetbrains.com
- sargstuff 4y agoarc [1] / racket implimentation of demystifycpp might be able to provide something 'usable'/presentable at the command line and/or as a straight up web browser html file. [1] : https://arclanguage.github.io/ https://arclanguage.github.io/