// Sorted array-based list template class SAList: protected AList { public: SAList(int size=DefaultListSize) : AList(size) {} ~SAList() {} // Destructor AList::clear; // Expose AList clear method // Redefine insert function to keep values sorted bool insert(const Elem& item) { // Insert at right Elem curr; for (setStart(); getValue(curr); next()) if(!Compare::lt(curr, item)) break; return AList::insert(item); } // All remaining methods are exposed from AList AList::remove; AList::setStart; AList::setEnd; AList::prev; AList::next; AList::leftLength; AList::rightLength; AList::setPos; AList::getValue; AList::print; };