If you expand a std::vector<T>
in the watch window, you'll get items like "[0]", "[1]" etc, one for each value in the collection.
When implementing my own collection class (which, incidentally, wraps a dynamic array), I want this same functionality.
How does Visual Studio know how many elements to display in the watch window for std::vector
?
There is a file called autoexp.dat
which the debugger uses to interpret custom types. It's not officially meant to be edited, but we have used it in-house for collection types and it works okay. There are some rough edges.
http://msdn.microsoft.com/en-us/library/zf0e8s14.aspx
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