May 2015
Intermediate to advanced
572 pages
9h 52m
English
CHAPTER 11
![]()
Debugging Templates
As TMP code induces the compiler to perform calculations, it’s virtually impossible to follow it step by step. However, there are some techniques that can help. This chapter in fact contains a mix of pieces of advice and debugging strategies.
11.1. Identify Types
Modern debuggers will always show the exact type of variables when the program is stopped. Moreover, a lot of information about types is visible in the call stack, where (member) functions usually are displayed with their full list of template arguments. However, you’ll often need to inspect intermediate results and return types.
The following function ...