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 p
Most simply method is you have to ready a pointer to watch variable like this.
vector a = { 0,1,2,3,4,5 };
int* ptr = &a[0]; // watch this ptr in VisualStudio Watch window like this "ptr,6".
I tried "a._Myfirst[0]" in VisualStudio2015, But It wasn't display array data.
If you can use "natvis", it will resolve your problems.
This is "sample.natvis" for display std::vector data for Visual studio 2015.
{{ size={_Mypair._Myval2._Mylast - _Mypair._Myval2._Myfirst} }}
- _Mypair._Myval2._Mylast - _Mypair._Myval2._Myfirst
- _Mypair._Myval2._Myend - _Mypair._Myval2._Myfirst
_Mypair._Myval2._Mylast - _Mypair._Myval2._Myfirst
_Mypair._Myval2._Myfirst
Before
After