/* Copyright (c) 1992 by AT&T Bell Laboratories. */ /* Advanced C++ Programming Styles and Idioms */ /* James O. Coplien */ /* All rights reserved. */ template class Array: public CollectionRep { public: Array(); Array(Array&); ~Array(); class Collection make(); class Collection make(int size); T& operator[](int i); void put(const T&); private: T *vec; int size; }; template struct HashTableElement { HashTableElement *next; T *element; }; template class HashTable: public CollectionRep { public: HashTable(); HashTable(HashTable&); ~HashTable(); class Collection make(); class Collection make(int); T& operator[](int i); T& operator[](S); void put(const T&); private: int nbuckets; virtual int hash(int l); HashTableElement *buckets; };