class Enumeration { public: virtual bool hasMoreElements () const = 0; virtual Object& nextElement () = 0; };Given an enumeration e for some container c, the contents of c can be printed like this:
while (e.hasMoreElements ()) cout << e.nextElement () << endl;Devise a wrapper class to encapsulate an iterator and provide the functionality of an enumeration.