32 return std::numeric_limits<T>::min();
36 return std::numeric_limits<T>::max();
41 if( b.value > 0 &&
a.value > (std::numeric_limits<T>::max() - b.value) )
FC_CAPTURE_AND_THROW( overflow_exception, (
a)(b) );
43 return safe(
a.value + b.value );
48 if( b.value < 0 &&
a.value > (std::numeric_limits<T>::max() + b.value) )
FC_CAPTURE_AND_THROW( overflow_exception, (
a)(b) );
49 return safe(
a.value - b.value );
58 if(
a.value > (std::numeric_limits<T>::max() / b.value) )
FC_CAPTURE_AND_THROW( overflow_exception, (
a)(b) );
73 if(
a.value != 0 && b.value < (std::numeric_limits<T>::max() /
a.value) )
FC_CAPTURE_AND_THROW( overflow_exception, (
a)(b) );
77 return safe(
a.value * b.value );
83 if(
a.value == std::numeric_limits<T>::min() && b.value == -1 )
FC_CAPTURE_AND_THROW( overflow_exception, (
a)(b) );
84 return safe(
a.value / b.value );
89 if(
a.value == std::numeric_limits<T>::min() && b.value == -1 )
FC_CAPTURE_AND_THROW( overflow_exception, (
a)(b) );
90 return safe(
a.value % b.value );
151 return a.value == b.value;
164 return a.value < b.value;
177 return a.value > b.value;
Defines exception's used by fc.
#define FC_CAPTURE_AND_THROW(EXCEPTION_TYPE,...)
file_not_found_exception parse_error_exception invalid_arg_exception invalid_operation_exception key_not_found_exception bad_cast_exception out_of_range_exception canceled_exception assert_exception eof_exception unknown_host_exception null_optional udt_exception aes_exception overflow_exception underflow_exception(divide_by_zero_exception)) namespace detail
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
#define T(meth, val, expected)
#define FC_REFLECT_TEMPLATE(TEMPLATE_ARGS, TYPE, MEMBERS)
friend safe operator%(const safe &a, const safe &b)
safe & operator+=(const safe &b)
friend bool operator>(const safe &a, const safe &b)
friend safe operator-(const safe &a, const safe &b)
friend safe operator*(const safe &a, const safe &b)
friend bool operator==(const safe &a, const safe &b)
friend bool operator!=(const safe &a, const safe &b)
safe & operator*=(const safe &b)
friend bool operator>=(const safe &a, const safe &b)
friend safe operator+(const safe &a, const safe &b)
safe & operator-=(const safe &b)
safe & operator/=(const safe &b)
friend bool operator<(const safe &a, const safe &b)
safe & operator%=(const safe &b)
friend bool operator<=(const safe &a, const safe &b)
friend safe operator/(const safe &a, const safe &b)