Note that there are some explanatory texts on larger screens.

plurals
  1. PO"Shallow" display of STL containers in Visual Studio debug mode?
    text
    copied!<p>I hit a wall while debuging my C++ class. It's a graph of sorts, something like this:</p> <pre><code>class Graph { class Node { std::map&lt;int, Node&gt;::iterator _neighbors[4]; }; std::map&lt;int, Node&gt; _map; }; </code></pre> <p>Basically, each node keeps track of exactly 4 neighbors by storing iterators to them in the containing class' map.</p> <p>The problem is that when I go to display the contents of _map in VS2008 during debugging, I get something like this:</p> <pre><code>- _map - [0] first - second - _neighbors - _ptr first - second - _neighbors - _ptr first - second - _neighbors ... </code></pre> <p>Apparently, instead of listing the 4 neighbors of the Node with index 0 in the map, it lists its first neighbor, then the first neighbor's first neighbor, then its first neighbor and so on ad infinity. Also, at no point does <code>_neighbors</code> appear as an array, even though it is declared as such.</p> <p>I found an add-on called <a href="http://vsedebug.sourceforge.net/" rel="nofollow noreferrer" title="VSEDebug">VSEDebug</a> that supposedly has enhanced STL display, but it's for VS2k3 and I couldn't get it to work in 2k8 (neither the binaries, nor compiling it myself).</p> <p>The immediate window isn't much help either, as trying to call <code>_map.operator[]</code> returns with <code>CXX0058: Error: overloaded operator not found</code>.</p> <p>Any ideas how I can get a meaningful display of the contents of my map? Note that I'm fairly new to VS as a whole, so I'll probably need detailed instructions. :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload