Zoltan Porkolab: Debugging and Profiling C++ Template Metaprograms
Why Stack Overflow recommends it
Stack Overflow users link it when someone needs to see what the compiler is doing during template instantiation, such as tracing metaprogram execution or finding why compile time and memory balloon.
Recommended by 2 people across 2 different months, 2010 to 2014.
What it is
A C++Now 2013 conference talk by Zoltan Porkolab presenting a prototype debugger and profiler for C++ template metaprograms, built on llvm/clang. The tool records the template instantiation stack as an XML trace to help find bugs and compile-time bottlenecks in template-heavy code.
What people said
Recommends indeterminately sequenced · 2013-08 · Stack Overflow · on “constexpr: saving calculation results”
I don't know of any tool/compiler flag which does this but perhaps you can modify the tool demonstrated here for template meta-programs [this video] .
Recommends Graznarak · 2014-10 · Stack Overflow · on “How can I reduce the compile-time memory footprint of large templates?”
In 2013 at C++Now there was a presentation on a tool for template metaprogramming debugging that might be useful to figure out what it going on. Presentation: [this video] Slides: [LINK] Actual tool: [LINK]
Cites jmihalicza · 2010-03 · Stack Overflow · on “C++ Template Metaprogramming - Is it possible to output the generated code?”
Check my publication on C++ template metaprogram debugging [LINK] From page 6 you can see how it works. For specific purposes you won't need the whole toolchain, it can be done by hand. I have put together a Visual C++ add-in where you could place breakpoints etc. but it was rather a proof of concept than a tool for every day use. We have been working on a graphical frontend that shows all the instantiations, allows debugging, profiling. Unfortunately we cannot promise any publish date for that tool, as we do it in our quite limited free time. UPDATE: the debugger and profiler is available here [LINK] UPDATE: C++Now presentation [this video]