The trick here is:
Say what you have std::vector<int> v;and you want to see in the clock v[23]or maybe v[23]..v[23+n]do it:
- Add a variable to the viewport.
- Add
,!after the variable name (ex:) v,!to indicate to VS that you want to disable the debugger visualization. - Expand the elements of the vector until you see
_Myfirst, _Mylastand _Myend. Add _Myfirstto the watch. This is a pointer to the beginning of the vector memory. - Remove
v,!with a clock if you want. _Myfirst, , + offset, count, offset - , , count - , . : (*((std::_Vector_val<std::_Simple_types<int> >*)(&(*((std::_Vector_alloc<0,std::_Vec_base_types<int,std::allocator<int> > >*)(&(v)))))))._Myfirst + 23, 100. 100 , 23 (, , _Myfirst). offset count (: v[n] offset n count , , .
, Going Native Episode 28 17- , . , .
v[n] = ... + pre_calculate(v[n]) + ...
// You could put a comment like this:
// (*((std::_Vector_val<std::_Simple_types<int> >*)(&(*((std::_Vector_alloc<0,std::_Vec_base_types<int,std::allocator<int> > >*)(&(v)))))))._Myfirst + n, 100
// And when you hover the mouse over the selected expression, you see the evaluation. Much better I think.