A few times I use a restricted interface over a vector or another mutable sequence ( a sequence adapter) which only allows push_back and clear. It has some nice property such as, an iterator can be designed based on index which is always stable (like stable_vector but also has element contiguity) and hence can be stored without fear of invalidation unless it is cleared.
I want to use a adapter class instead of vector or another sequence directly to emphasize the interface (as well as to prevent any accidental mistake using unsupported operations such as insert , erase etc).
Is there any existing ADT which matches with this append_only sequence? Otherwise can anyone recommend a suitable name for this sequence adapter?
I don’t think there is any existing ADT to do what you want. As for the name I would go with
PushOnlyVectoror something of the kind. In fact I also like theappend_onlyin your question so you may also make use of it:AppendOnlyVector. And one last option:GrowingArray. I keep thevectororarrayas part of the name to emphasize you support index operation.