If I have a std::vector
or std::map
variable, and I want to see the contents, it's a big pain to see the nth element while debugging. Is there a plugin, or some trick to making it easier to watch STL container variables while debugging (VS2003/2005/2008)
?
@BjörnPollex Yes! I forgot to mention that.
In C++, STL Unordered Associative Containers provide the unsorted versions of the associative container. Internally, unordered associative containers are implemented as hash table data structures.
If you want to watch more than one element at the same time, you can append a comma and the number of elements as so:
(v._Myfirst)[startIndex], count
However, note that count must be a constant, it cannot be the result of another expression.
For vectors, this thread on the msdn forums has a code snippet for setting a watch on a vector index that might help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With