Commonality of Interface
To keep things simple and allow you to program with more flexibility, we have implemented common interfaces within the various divisions of standard-library based collection class templates. For example, the RWTPtrSet<T,C,A> and RWTPtrMultiSet<T,C,A> templates have interfaces identical to their value-based cousins; so do the map-based collection classes. All of the Sequence-based collections have nearly identical interfaces within the value and pointer-based subgroups. (An exception here is the set of deque-based classes, which contain push and pop member functions designed to enhance their abstraction of the queue data structure.)
There are advantages and disadvantages to this approach. The disadvantage is that it puts slightly more of the burden on you, the developer, to choose the appropriate collection class. Had we chosen not to provide the insertAt(size_type index) member function for class RWTValOrderedVector<T,A>, we could have enforced the idea that vector-based templates are not a good choice for inserting into the middle of a collection class. Instead, it is up to you to be aware of your choices and use such member functions carefully.
The advantages are that the common interface lowers the learning curve, that it allows flexibility in experimenting with different collections, and that it provides the capability of dealing with the Rogue Wave templates polymorphically via genericity. For a discussion of genericity versus inheritance, see Meyer (1988).
Real-life programming is seldom as neat as the exercises in a data structures textbook. You may find yourself in a situation where it is difficult to balance the trade-offs and determine just which collection class to use. With the common interface, you can easily benchmark code that uses an RWTValDeque<T,A> and later benchmark it again, substituting an RWTValOrderedVector<T,A> or RWTValDlist<T,A>. You can also write class and function templates that are parameterized on the collection class type. For example:
 
template <class RWSeqBased>
void tossHiLo(RWSeqBased& coll) {
// throw out the high and low values:
assert(coll.entries() >= 2); // precondition
coll.sort();
coll.removeFirst();
coll.removeLast();
}
Thanks to the common interface, the above function template will work when instantiated with any of the Rogue Wave Sequence-based templates.