diff --git a/msw/include/boost/units/quantity.hpp b/msw/include/boost/units/quantity.hpp index 4fe916d..b405829 100644 --- a/msw/include/boost/units/quantity.hpp +++ b/msw/include/boost/units/quantity.hpp @@ -280,6 +280,16 @@ class quantity ///< can divide a quantity by a scalar value_type if divide_typeof_helper::type is convertible to value_type this_type& operator/=(const value_type& source) { val_ /= source; return *this; } + this_type& operator++() + { ++val_; return *this; } + this_type operator++(int) + { this_type rval = *this; val_++; return rval; } + + this_type& operator--() + { --val_; return *this; } + this_type operator--(int) + { this_type rval = *this; val_--; return rval; } + /// Construct quantity directly from @c value_type (potentially dangerous). static this_type from_value(const value_type& val) { return this_type(val, 0); } @@ -1139,6 +1149,12 @@ operator/(const quantity& lhs, return type::from_value(lhs.value()/rhs.value()); } +/// runtime operator% +template +inline +quantity operator%(const quantity& lhs, const Y& rhs) +{ return quantity::from_value(lhs.value() % rhs); } + /// runtime operator== template