template< class T >
  class bag { 
\fbox{bag<T>}
public: bag() { s = new list<T>; } bag(const bag<T>& b) { s = b.s; } ~bag() { delete s; } bag<T>& operator=(const bag<T>& b) { s = b.s; return *this; } virtual void insert(const T& e) { s->insert(e); } operator iter<T>() const { return *s; } int count(const T& e) const; void map(T f(const T& e)); protected: list<T>* s;
see section gen-list

};

slide: The implementation of a bag