
"David Abrahams" <dave@boost-consulting.com> wrote
I still see no a priori reason that circular_buffer must do element destruction before it is itself destroyed. std::vector *has* to do some destruction in order to get the right semantics. Arguably, circular_buffer does not. If it doesn't matter *which* vector elements get destroyed upon erase, then I presume it doesn't matter which circular_buffer elements get destroyed. In that case, why should it matter that any elements are destroyed?
If you have class and the class has static member keeping number of object instances alive (incremented in constructor, decremented in destructor): - putting these objects into vector keeps counter valid, - circular_buffer with assignement won't. That was problem I did have with earlier version of circular_buffer and that' why I did ask for construct/destruct feature. It is maybe border case but IMHO valid one against assignement. /Pavel