The Java programming language provides
the notion of an enumeration as the means to
iterate through the objects in a container.
In C++ we can define enumerations like this:
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.