//: C04:WordSet.cpp // From Thinking in C++, 2nd Edition // Available at http://www.BruceEckel.com // (c) Bruce Eckel 2000 // Copyright notice in Copyright.txt #include "../require.h" #include #include #include #include using namespace std; int main(int argc, char* argv[]) { requireArgs(argc, 1); ifstream source(argv[1]); assure(source, argv[1]); string word; set words; while(source >> word) words.insert(word); copy(words.begin(), words.end(), ostream_iterator(cout, "\n")); cout << "Number of unique words:" << words.size() << endl; } ///:~