Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view C++ template argument in watch window in VS2015

I am debugging some C++ code which contains some C++ templates with T as an template argument. I would like to see in watch (or on mouse over) what type is T.

When I add T to watch, it does not show the type. Is there a way to resolve T argument in debugger?

I can see the template arguments types on call stack. As the types are quite complex, the lines in the he call stack is so long, that cannot fit my display. And very hard to read.

Is there a way to resolve T argument in debugger watch?

I use Visual Studio 2015 Update 3.

enter image description here

like image 346
Tomas Kubes Avatar asked Oct 29 '22 20:10

Tomas Kubes


1 Answers

Add _First or _Last to the watch widow, they are of type _Iter, and the resolved type will be displayed. I don't think there is any other way: at compile time _Iter is replaced by whatever type is used, so once the application is built there's no notice of the name _Iter anymore.

like image 141
stijn Avatar answered Nov 15 '22 06:11

stijn