Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat do I need to enter in autoexp.dat in order to be able to inspect a data member of a class contained in a vector?
    primarykey
    data
    text
    <p>First, an apology: I've read some previous threads about inspecting templates in VS (e.g. <a href="https://stackoverflow.com/questions/104959/what-is-the-best-way-to-inspect-stl-containers-in-visual-studio-debugging">this one</a>); unfortunately they either did not contain the information I need or (more likely) I was not able to extract the information successfully from the answers. I hope I'm not asking something too obvious that has been asked many times before.</p> <p>I have a vector containing objects of class SomeClass:</p> <pre><code>class SomeClass { int a, b; //constructor.. }; std::vector&lt;SomeClass&gt; vec; //vec.push some elements.. </code></pre> <p>Now I want to be able to watch vec[0].a, vec[1].a, .... in the VS2010 debugger. When I naively try this I ofcourse get:</p> <pre><code>vec[0].a CXX0058: Error: overloaded operator not found </code></pre> <p>And when I try one of the solutions offered in the answers to the question I linked to above, I get:</p> <pre><code>((vec)._Myfirst)[0].a CXX0025: Error: operator needs class/struct/union </code></pre> <p>So I understand I need to modify autoexp.dat. I tried doing this for a while with no success whatsoever.</p> <p>I would really appreciate it if someone could write what line/s I need to add to autoexp.dat in order to be able to inspect these variables (I already feel that I've spent way too much time on this - and so I would be very grateful if I could get an explicit solution rather than hints or links).</p> <p>Thank you for your time.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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