Francisco Aguilera
Francisco Aguilera

Reputation: 3482

visual studio 2013 debug iterator container

I'm doing a lot of debugging dealing with iterators right now, and wanted to know if anybody knew a simple way to get a watch variable with all of the elements in the container being referenced by the iterators, as the functions only have access to the iterators and not the containers themselves.

Maybe some way to enumerate starting from the iterator and the next x elements?

Upvotes: 1

Views: 242

Answers (1)

Francisco Aguilera
Francisco Aguilera

Reputation: 3482

As Praetorian mentioned, in VS you can enumerate the values of the pointer to see the contents of the container your iterator is iterating over.

A watch variable like:

(MyIterator)._Ptr, 5

or

(MyIterator)._Ptr, NumElements

will enumerate the first NumElements elements in the container.

Upvotes: 1

Related Questions