# ifndef ORDEREDLIST # define ORDEREDLIST // // OrderedList class description // // requires the list class be previously included // // Described in Chapter 9 of // Data Structures in C++ using the STL // Published by Addison-Wesley, 1997 // Written by Tim Budd, budd@cs.orst.edu // Oregon State University // template class orderedList : public list { public: void add (T & newValue); }; template void orderedList::add (T & newValue) { list::iterator start, stop; start = begin(); stop = end(); while ((start != stop) && (*start < newValue)) ++start; insert (start, newValue); } # endif