| 11 | |
| 12 | |
| 13 | struct DefaultOnly { |
| 14 | int data_; |
| 15 | DefaultOnly(DefaultOnly const&) = delete; |
| 16 | DefaultOnly& operator=(DefaultOnly const&) = delete; |
| 17 | |
| 18 | static int count; |
| 19 | |
| 20 | DefaultOnly() : data_(-1) { ++count; } |
| 21 | ~DefaultOnly() { data_ = 0; --count; } |
| 22 | |
| 23 | friend bool operator==(DefaultOnly const& x, DefaultOnly const& y) |
| 24 | { return x.data_ == y.data_; } |
| 25 | |
| 26 | friend bool operator< (DefaultOnly const& x, DefaultOnly const& y) |
| 27 | { return x.data_ < y.data_; } |
| 28 | }; |
| 29 | |
| 30 | int DefaultOnly::count = 0; |
| 31 |