Howard Hinnant | 3e51952 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | #ifndef REP_H |
2 | #define REP_H | ||||
3 | |||||
4 | class Rep | ||||
5 | { | ||||
6 | int data_; | ||||
7 | public: | ||||
8 | Rep() : data_(-1) {} | ||||
9 | explicit Rep(int i) : data_(i) {} | ||||
10 | |||||
11 | bool operator==(int i) const {return data_ == i;} | ||||
12 | bool operator==(const Rep& r) const {return data_ == r.data_;} | ||||
13 | |||||
14 | Rep& operator*=(Rep x) {data_ *= x.data_; return *this;} | ||||
15 | Rep& operator/=(Rep x) {data_ /= x.data_; return *this;} | ||||
16 | }; | ||||
17 | |||||
Howard Hinnant | 94b2dd0 | 2010-08-22 00:59:46 +0000 | [diff] [blame] | 18 | #endif // REP_H |