Post by Martin T.
sizeof(T) is calculated at compile time.
However, the only way to get at the numeric value of sizeof(T) I've
found so far is to add a codeline int x = sizeof(T); and then check x in
the watch window.
Is it somehow possible to let sizeof(T) be evaluated by the debugger (or
even better display the value the compiler generates?)
Occasionally I find myself debugging and would like to know what
sizeof(T) (and _countof) is giving me.
Other than dropping into the disassembly view and checking the values
that way, I can't see a way of seeing the value of sizeof in the
I suggest that you file a bug/suggestion report for it against Visual
Studio on the MS connect web site. If you post a link back to your
suggestion report here I'll add a vote to it as I think it'd be a
useful addition if it's not too difficult for MS to achieve.