diff --git a/doc/v2/operators.html b/doc/v2/operators.html
index aad2e583..6d40beeb 100755
--- a/doc/v2/operators.html
+++ b/doc/v2/operators.html
@@ -828,19 +828,28 @@ struct number
: boost::integer_arithmetic<number>
{
- number(long x_) : x(x_) {}
- operator long() const { return x; }
+ explicit number(long x_) : x(x_) {}
+ operator long() const { return x; }
- number& operator+=(number const& rhs)
- { x += rhs; }
- number& operator-=(number const& rhs)
- { x -= rhs; }
- number& operator*=(number const& rhs)
- { x *= rhs; }
- number& operator/=(number const& rhs)
- { x /= rhs; }
- number& operator%=(number const& rhs)
- { x %= rhs; }
+ template <class T>
+ number& operator+=(T const& rhs)
+ { x += rhs; return *this; }
+
+ template <class T>
+ number& operator-=(T const& rhs)
+ { x -= rhs; return *this; }
+
+ template <class T>
+ number& operator*=(T const& rhs)
+ { x *= rhs; return *this; }
+
+ template <class T>
+ number& operator/=(T const& rhs)
+ { x /= rhs; return *this; }
+
+ template <class T>
+ number& operator%=(T const& rhs)
+ { x %= rhs; return *this; }
long x;
};
@@ -848,7 +857,7 @@ struct number
using namespace boost::python;
BOOST_PYTHON_MODULE(demo)
{
- class_<number>("number")
+ class_<number>("number", init<long>())
// interoperate with self
.def(self += self)
.def(self + self)