title: gdb Could not find operator[]
body: <pre><code>double var1, var2;
  std::vector&lt;double *&gt; x;
  
  var1 = 1;
  var2 = 2;
  
  x.push_back(&amp;var1);
  x.push_back(&amp;var2);
  </code></pre>
  
  <p>When I debug this code in gdb and try <code>print x[0]</code> or <code>*x[0]</code> I get: </p>
  
  <blockquote>
    <p>Could not find operator[].</p>
  </blockquote>
  
  <p>Now if I include this line after the <code>push_back</code>:</p>
  
  <pre><code>x[0] = &amp;var1;
  </code></pre>
  
  <p>I can access any specific elements in gdb. The same thing happens with other members such as <code>front()</code>, <code>at()</code>, etc. My understanding is that the compiler/linker includes only the member functions present in the source code and those are the ones I can use in gdb. Is there a way to include every member function of <code>std::vector</code> so I can access them in gdb?</p>