00001 00027 // 00028 // file List.hpp 00029 // defines several instances of Lst classes 00030 // 00031 // 29/04/2003 Manchester 00032 // 00033 00034 #ifndef __Lists__ 00035 #define __Lists__ 00036 00037 00038 #include "Lst.hpp" 00039 00040 00041 class IntList 00042 : public Lst<int> 00043 { 00044 public: 00045 // constructors 00046 IntList (); 00047 IntList (const IntList&); 00048 explicit IntList (int); // one-element list 00049 IntList (int head, const IntList& tail); 00050 00051 // inherited functions 00052 const IntList& tail () const 00053 { return static_cast<const IntList&>(Lst<int>::tail()); } 00054 }; // class IntList 00055 00056 00057 // ******************* IntList definitions ************************ 00058 00059 inline 00060 IntList::IntList () 00061 : 00062 Lst<int> () 00063 { 00064 } // IntList::IntList 00065 00066 00067 // copy constructor 00068 inline 00069 IntList::IntList (const IntList& ts) 00070 : 00071 Lst<int> (ts) 00072 { 00073 } // IntList::IntList 00074 00075 00076 // 'cons' list constructor 00077 inline 00078 IntList::IntList (int hd, const IntList& tl) 00079 : 00080 Lst<int> (hd,tl) 00081 { 00082 } // IntList::IntList 00083 00084 00085 // one-element list constructor 00086 inline 00087 IntList::IntList (int hd) 00088 : 00089 Lst<int> (hd) 00090 { 00091 } // IntList::IntList 00092 00093 00094 #endif // __Lists__ 00095