Click to See Complete Forum and Search --> : std::vector in autoexp


Alexey B
December 6th, 2003, 01:35 PM
good day

I have VS.NET2003. By default, the debugger shows the size of all containers except std::vector, for which it shows only _Myfirst and _Mylast. I would like it to show the size of vector, but neither "std::vector<*>=&ltsize()&gt" nor "std::vector<*>=<_Mylast-_Myfirst>" works. Does anyone have a solution?

thank you

Andreas Masur
December 6th, 2003, 01:44 PM
[Moved thread]

Andreas Masur
December 6th, 2003, 01:44 PM
If you have a vector<T> sample; you can evaluate the following expressions in the watch window:

1. sample.size() -> Obvious

2. sample._M_start,10 -> Displays the first 10 items of the vector

Alexey B
December 6th, 2003, 02:00 PM
Even faster way, of course, is to simply figure out the size via mental arithmetic from _Myfirst and _Mylast, but I want more convinience. :) Writing "std::vector<*>=size=&ltsize(),u&gt" in autoexp used to work in VS6.0, but does not work in VS7.1.