kevin42 kevin42 - 1 month ago 10
C++ Question

Inspecting STL containers in Visual Studio debugging

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)
?

Answer

For vectors, this thread on the msdn forums has a code snippet for setting a watch on a vector index that might help.