# | Line 21 | Line 21 | bool contains(const Type& value, DoublyL | |
---|---|---|
21 | return false; | |
22 | } | |
23 | ||
24 | + | class VowelVisitor : public Visitor<string> |
25 | + | { |
26 | + | public: |
27 | + | void visit(const string& value) { if (value.find_first_of("aAeEiIoOuU") == 0) cout << value << '\n'; } |
28 | + | }; |
29 | + | |
30 | int main(int argc, char* argv[]) | |
31 | { | |
32 | cout.setf(ios_base::boolalpha); | |
# | Line 68 | Line 74 | int main(int argc, char* argv[]) | |
74 | if (itor->find_first_of("aAeEiIoOuU") == 0) cout << *itor << '\n'; | |
75 | } | |
76 | ||
77 | + | VowelVisitor vowels; |
78 | + | |
79 | + | words.accept(dynamic_cast<Visitor<string>*>(&vowels)); |
80 | + | |
81 | return 0; | |
82 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |