Added the GDB trick to visualize the components of a vector
(but it still doesn't work with EO objects, though???)
This commit is contained in:
parent
f2b98abd90
commit
b8da2db21f
1 changed files with 8 additions and 4 deletions
|
|
@ -292,16 +292,20 @@ method will take more time for vectors than for linked lists, while on
|
|||
the opposite, the operator[] accessor will be faster for vectors. But both
|
||||
will work anyway.
|
||||
<p><b><font color="#FF0000">STL: </font><font color="#000099">Drawbacks</font></b>
|
||||
<br>The main drawback I see in using STL is that it makes it almost
|
||||
<b><font color="#FF6600">impossible
|
||||
<br>The main drawback I see in using STL is that it makes it
|
||||
<b><font color="#FF6600">difficult
|
||||
to use a debugger </font></b>normally: whereas access to data is made simple
|
||||
to the programmer, data structures are actually so complex, and debuggers
|
||||
so willing to display everything that you get lines of template instantiation
|
||||
when asking your debugger what is inside some container! For instance I
|
||||
when asking your debugger what is inside some container! <br>
|
||||
However, here is a trick (thanks to Arnaud Quirin!) to actually print what is inside an STL vector with gdb (but it doesn't really work with complex structures like EO genotypes :-( :<br/>
|
||||
<b><tt>(gdb) <font color="#993300">print (*(&v))[i]<br/>
|
||||
$1 = (const double &) @0x934cad0: 0.69543264131061733<br/></font></tt></b>
|
||||
<!-- For instance I
|
||||
could never visualize some
|
||||
<b><tt><font color="#993300">v[i]</font></tt></b>
|
||||
with <b><tt><font color="#FF6600">gbd</font></tt></b>, <b><tt><font color="#993300">v</font></tt></b>
|
||||
being an STL vector!
|
||||
being an STL vector! -->
|
||||
<p>
|
||||
<hr WIDTH="100%">
|
||||
<br><a NAME="random"></a><b><font color="#000099"><font size=+1>Random
|
||||
|
|
|
|||
Reference in a new issue