| 28 | using namespace boost::python; |
| 29 | |
| 30 | struct X : test_class<> |
| 31 | { |
| 32 | typedef test_class<> base_t; |
| 33 | |
| 34 | X(int x) : base_t(x) {} |
| 35 | X const operator+(X const& r) const { return X(value() + r.value()); } |
| 36 | |
| 37 | // typedef int (X::*safe_bool)() const; |
| 38 | // operator safe_bool() const { return value() != 0 ? &X::value : 0; } |
| 39 | }; |
| 40 | |
| 41 | X operator-(X const& l, X const& r) { return X(l.value() - r.value()); } |
| 42 | X operator-(int l, X const& r) { return X(l - r.value()); } |