How to expand/“preprocess” C++ template code

后端 未结 3 1357
心在旅途
心在旅途 2020-12-08 09:47

To properly debug complex macros in C++ I usually run the preprocessor on them in order to see exactly what the resulting code looks like.

Is there a similar way to

3条回答
  •  不思量自难忘°
    2020-12-08 10:32

    This is a fairly old question, but I think there has been significant improvements in this area that are not so widely known (yet).

    Metashell can be used like a sort of gdb for template instantiations. This (as far as I know) builds on clang tooling.

提交回复
热议问题