Eee... I don't even know if the name I am calling this is correct or not... but I am wondering if there is a template tracker for C++ out there somewhere. The functionality of it would be similar to the GCC compilers' -E
switch (which expands all the macros), the only difference is that it would show the same thing for templates, such as which classes have been created, together with partial specializations, source code, which templated method are called, template parameter deduction, etc...
Asked
Active
Viewed 251 times
9

Ferenc Deak
- 34,348
- 17
- 99
- 167
-
7And allow normal people to debug template errors? We'd all be out of a job in no time. – Kerrek SB Apr 07 '14 at 10:03
-
@KerrekSB Hahaha :D Then maybe I should delete this question :P – Ferenc Deak Apr 07 '14 at 10:05
-
@KerrekSB: _Normal_ what normal? Aren't we all normal? :) – legends2k Apr 07 '14 at 10:09
-
A few related questions http://stackoverflow.com/q/1219007/19093 and http://stackoverflow.com/q/4448094/19093 – Jiří Pospíšil Apr 07 '14 at 10:10
-
1I could imagine such could be achieved with a LLVM/CLang frontend plugin. – πάντα ῥεῖ Apr 07 '14 at 10:20
2 Answers
2
There is Templight, which makes it possible to trace template instantiations.

Fabio Fracassi
- 3,791
- 1
- 18
- 17
0
Template tracking needs human expertise. A clue could be replace all template types with some possible concrete types and check through stepping through / debugging, once you are convinced, get into the generic version using template.

Dr. Debasish Jana
- 6,980
- 4
- 30
- 69