00001 #ifndef WORD_H
00002 #define WORD_H
00003
00004
00005 #include <string>
00006 #include <iostream>
00007 #include <stdexcept>
00008
00014 class Word {
00015 public:
00020 Word(const string& w="");
00024 operator string() const { return w_; }
00028 const string& str() const { return w_; }
00036 friend istream&
00037 operator>>(istream&, Word& w);
00038 friend bool
00039 operator==(const Word& w1, const Word& w2) { return w1.w_ == w2.w_; }
00040 friend bool
00041 operator<(const Word& w1, const Word& w2) { return w1.w_ < w2.w_; }
00045 private:
00046 string w_;
00047 };
00048
00049 #endif
00050