--- UnitTest.cpp 2004/05/14 18:54:07 9 +++ UnitTest.cpp 2004/05/14 20:57:49 10 @@ -21,6 +21,12 @@ bool contains(const Type& value, DoublyL return false; } +class VowelVisitor : public Visitor +{ +public: + void visit(const string& value) { if (value.find_first_of("aAeEiIoOuU") == 0) cout << value << '\n'; } +}; + int main(int argc, char* argv[]) { cout.setf(ios_base::boolalpha); @@ -68,5 +74,9 @@ int main(int argc, char* argv[]) if (itor->find_first_of("aAeEiIoOuU") == 0) cout << *itor << '\n'; } + VowelVisitor vowels; + + words.accept(dynamic_cast*>(&vowels)); + return 0; }