Set the <ahref="../api_reference/C/dbset_flags.html#dbset_flags_DB_RENUMBER"class="olink">DB_RENUMBER</a> flag in the database handle if you want
<codeclass="classname">db_vector<></code> to work like
<codeclass="classname">std::vector</code> or <codeclass="classname">std::deque</code>. Do not set
<ahref="../api_reference/C/dbset_flags.html#dbset_flags_DB_RENUMBER"class="olink">DB_RENUMBER</a> if you want <codeclass="classname">db_vector<></code> to work like
<codeclass="classname">std::list</code>. Note that without <ahref="../api_reference/C/dbset_flags.html#dbset_flags_DB_RENUMBER"class="olink">DB_RENUMBER</a> set,
<codeclass="classname">db_vector<></code> can work faster.
</p>
<p>
For example, to construct a fast std::queue/std::stack object, you only need a
<codeclass="classname">db_vector<></code> object whose database handle does not have
<ahref="../api_reference/C/dbset_flags.html#dbset_flags_DB_RENUMBER"class="olink">DB_RENUMBER</a> set. Of course, if the database handle has <ahref="../api_reference/C/dbset_flags.html#dbset_flags_DB_RENUMBER"class="olink">DB_RENUMBER</a> set, it
still works for this kind of scenario, just not as fast.
</p>
<p>
<codeclass="classname">db_vector</code> does not check whether <ahref="../api_reference/C/dbset_flags.html#dbset_flags_DB_RENUMBER"class="olink">DB_RENUMBER</a> is set. If
you do not set it, <codeclass="classname">db_vector<></code> will not work like
std::vector<>/std::deque<> with regard to operator[], because the
indices are not maintained in that case.
</p>
<p>
You can find example code showing how to use this feature in the
Just as is the case with <codeclass="classname">std::vector</code>, inserting/deleting in
the middle of a <codeclass="classname">db_vector</code> is slower than doing the same
action at the end of the sequence. This is because the underlying DB_RECNO DB (with
the <ahref="../api_reference/C/dbset_flags.html#dbset_flags_DB_RENUMBER"class="olink">DB_RENUMBER</a> flag set) is relatively slow when inserting/deleting in the middle
or the head — it has to update the index numbers of all the records following
the one that was inserted/deleted. If you do not need to keep the index ordered on
insert/delete, you can use <codeclass="classname">db_map</code> instead.
</p>
<p>
<codeclass="classname">db_vector</code> also contains methods inherited from
<codeclass="classname">std::list</code> and <codeclass="classname">std::deque</code>,
including <codeclass="classname">std::list<>'s</code> unique methods