Boost logo

Boost :

From: AlisdairM (AlisdairM_at_[hidden])
Date: 2002-01-20 03:45:33

Jumping into the earlier discussion on sorted vectors, I am wondering why
the 'obvious' implementation is not deemed adequate?

A sorted vector should be (to my mind) exactly that, a vector that remains
sorted. Hence, all insert methods should also sort the vector, guaranteeing
the sorted condition. Obviously, the range-insertion methods become key to
efficient usage as they will (probably) sort once after inserting all new
members. push_back cannot really be supported, and pop_back raises symmetry
problems, but otherwise that would seem to be it to me (beyond hammering out
exception safety guarantees)

Any other concerns such as iterator stability are valid, but they aren't a
*sorted vector*, simply a better associative container that may (or may not)
be implemented in terms of a vector. Naming it after a vector is only going
to confuse.


Boost list run by bdawes at, gregod at, cpdaniel at, john at