add mult to safe

This commit is contained in:
Daniel Larimer 2015-03-01 09:53:21 -05:00
parent fd4fc4f0cb
commit e71ea52075

View file

@ -31,6 +31,7 @@ namespace fc {
if( b.value < 0 && a.value < std::numeric_limits<T>::min() - b.value ) FC_CAPTURE_AND_THROW( underflow_exception, (a)(b) );
return safe(a.value+b.value);
}
safe& operator *= ( T v ) { value *= v; return *this; }
safe& operator -= ( const safe& b ) { return *this += safe(-b.value); }
safe operator -()const{ return safe(-value); }