|
From: Steven W. <ste...@us...> - 2007-03-29 18:18:17
|
Update of /cvsroot/boost-sandbox/boost-sandbox/boost/units In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6983/boost-sandbox/boost/units Modified Files: quantity.hpp Log Message: Removed increment and decrement operators Index: quantity.hpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/boost/units/quantity.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- quantity.hpp 29 Mar 2007 16:51:51 -0000 1.3 +++ quantity.hpp 29 Mar 2007 18:18:14 -0000 1.4 @@ -136,11 +136,6 @@ // need to check that subtract_typeof_helper<value_type,value_type>==value_type this_type& operator-=(const this_type& source) { val_ -= source.val_; return *this; } ///< can subtract quantity of same type - this_type& operator++() { ++val_; return *this; } - this_type& operator++(int) { this_type temp(*this); ++*this; return temp; } - this_type operator--() { --val_; return *this; } - this_type operator--(int) { this_type temp(*this); --*this; return temp; } - this_type& operator*=(const value_type& val) { val_ *= val; return *this; } ///< can multiply quantity by scalar this_type& operator/=(const value_type& val) { val_ /= val; return *this; } ///< can divide quantity by scalar @@ -226,11 +221,6 @@ this_type& operator+=(const this_type& source) { val_ += source.val_; return *this; } ///< can add quantity of same type this_type& operator-=(const this_type& source) { val_ -= source.val_; return *this; } ///< can subtract quantity of same type // consider adding *=,/= for dimensionless_type - - this_type& operator++() { ++val_; return *this; } - this_type& operator++(int) { this_type temp(*this); ++*this; return temp; } - this_type operator--() { --val_; return *this; } - this_type operator--(int) { this_type temp(*this); --*this; return temp; } // can multiply or divide by value_type this_type& operator*=(const value_type& val) { val_ *= val; return *this; } ///< can multiply quantity by scalar @@ -264,13 +254,13 @@ template<class X, class Unit,class Y> X quantity_reinterpret_cast(const quantity<Unit,Y>& q) { - return reinterpret_cast<X>(const_cast<Y&>(q.value())); + return q.value(); } template<class X, class Unit,class Y> X quantity_reinterpret_cast(quantity<Unit,Y>& q) { - return reinterpret_cast<X>(const_cast<Y&>(q.value())); + return const_cast<Y&>(q.value()); } /// swap quantities |