debug and STL objects (vectors, maps, etc.) 
Author Message
 debug and STL objects (vectors, maps, etc.)

In Visual C++ (5.0 is what we're using), how do you see the contents of a
vector
in the VC++ de{*filter*}? I'd love to type v[3] and see what I get, or v.size(),
but the
de{*filter*} doesn't allow me to see inside. I can look at the first and last
arguments
because of the way MS is constructing the vectors (begin and end, I think)
but
nothing in between.


JDO



Sun, 29 Apr 2001 03:00:00 GMT  
 debug and STL objects (vectors, maps, etc.)

Evaluating the size function in the watch window works, but you can't use the
operator[] or at methods because there are const/non-const overloads and the
expression evaluator doesn't know how to resolve them.  

An easy workaround is to evalate v._First[n] instead of v[n].  _First
is just a pointer to a contiguous section of memory so you can always
dereference it for valid indexes of the vector.

Not guranteed to work with all STL implementations, but it does work with
VC5's.

HTH

: In Visual C++ (5.0 is what we're using), how do you see the contents of a
: vector
: in the VC++ de{*filter*}? I'd love to type v[3] and see what I get, or v.size(),
: but the
: de{*filter*} doesn't allow me to see inside. I can look at the first and last
: arguments
: because of the way MS is constructing the vectors (begin and end, I think)
: but
: nothing in between.
:

:
: JDO
:
:

--
--
/*  Andrew  */
WWW: http://www.*-*-*.com/ ;      



Mon, 30 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Win32 Debug vs.Win32 Release STL map<short, object*>::iterator

2. how to watch/debug STL vectors ans lists

3. debugging STL vectors

4. STL map debug problem

5. stl::map of objects

6. looping through an STL map object

7. Virtual Functions for Derived Objects held in STL Maps

8. Accessing map elements in vector of maps

9. stl::map - can't map int to char *

10. MFC map or stl map

11. STL Newbie: STL maps

12. Unicode Debug vs Debug, etc.

 

 
Powered by phpBB® Forum Software