template class indexxpair { public: KTYPE key; T * dataptr; template friend operator<(indexxpair a, indexxpair b); }; template class indexx { public: indexxpair pairs[M]; int size; int maxsize; int cursor; int findfirst(KTYPE k); indexx(); int insert(KTYPE k, T * dp); // Pre: None // Post: If the index is full, returns 1; otherwise, the pair (k,dp) is // added to the index int remove(KTYPE k); // Pre: None // Post: Returns 0 if k is not a key in the index; otherwise, the first pair // whose key is k is removed. Relative positions of the remaining // data don't change. T * lookup(KTYPE k); // Pre: None // Post: Returns NULL if k is not found as a key; otherwise, returns the data // pointer associated with the first pair with key k T * next(KTYPE k); // Pre: lookup must have been called with the given key and no insertions // or deletions may have been done in the interim // Post: Returns NULL if the next item has a non-matching key; otherwise, // returns the dataptr of the next key match. }; #include"indexx.cpp"