Lines Matching defs:Result
227 template <typename U, typename V> struct Result : ResultBase<typename RemoveChecked<U>::CleanType, typename RemoveChecked<V>::CleanType> {
230 template <typename LHS, typename RHS, typename ResultType = typename Result<LHS, RHS>::ResultType,
242 static inline bool add(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
254 result = lhs + rhs;
258 static inline bool sub(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
269 result = lhs - rhs;
273 static inline bool multiply(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
294 result = lhs * rhs;
304 static inline bool add(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
309 result = temp;
313 static inline bool sub(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
318 result = temp;
322 static inline bool multiply(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
325 result = 0;
330 result = lhs * rhs;
339 static inline bool add(int64_t lhs, int64_t rhs, ResultType& result)
346 result = static_cast<ResultType>(temp);
350 static inline bool sub(int64_t lhs, int64_t rhs, ResultType& result)
357 result = static_cast<ResultType>(temp);
361 static inline bool multiply(int64_t lhs, int64_t rhs, ResultType& result)
368 result = static_cast<ResultType>(temp);
379 static inline bool add(int64_t lhs, int64_t rhs, ResultType& result)
381 return ArithmeticOperations<int, unsigned, ResultType>::add(rhs, lhs, result);
384 static inline bool sub(int64_t lhs, int64_t rhs, ResultType& result)
386 return ArithmeticOperations<int, unsigned, ResultType>::sub(lhs, rhs, result);
389 static inline bool multiply(int64_t lhs, int64_t rhs, ResultType& result)
391 return ArithmeticOperations<int, unsigned, ResultType>::multiply(rhs, lhs, result);
400 template <typename U, typename V, typename R> static inline bool safeAdd(U lhs, V rhs, R& result)
402 return ArithmeticOperations<U, V, R>::add(lhs, rhs, result);
405 template <typename U, typename V, typename R> static inline bool safeSub(U lhs, V rhs, R& result)
407 return ArithmeticOperations<U, V, R>::sub(lhs, rhs, result);
410 template <typename U, typename V, typename R> static inline bool safeMultiply(U lhs, V rhs, R& result)
412 return ArithmeticOperations<U, V, R>::multiply(lhs, rhs, result);
579 double result = rhs * m_value;
581 if (!(std::numeric_limits<T>::min() <= result && std::numeric_limits<T>::max() >= result))
583 m_value = (T)result;
649 template <typename U, typename V, typename OverflowHandler> static inline Checked<typename Result<U, V>::ResultType, OverflowHandler> operator+(Checked<U, OverflowHandler> lhs, Checked<V, OverflowHandler> rhs)
654 typename Result<U, V>::ResultType result = 0;
655 overflowed |= !safeAdd(x, y, result);
658 return result;
661 template <typename U, typename V, typename OverflowHandler> static inline Checked<typename Result<U, V>::ResultType, OverflowHandler> operator-(Checked<U, OverflowHandler> lhs, Checked<V, OverflowHandler> rhs)
666 typename Result<U, V>::ResultType result = 0;
667 overflowed |= !safeSub(x, y, result);
670 return result;
673 template <typename U, typename V, typename OverflowHandler> static inline Checked<typename Result<U, V>::ResultType, OverflowHandler> operator*(Checked<U, OverflowHandler> lhs, Checked<V, OverflowHandler> rhs)
678 typename Result<U, V>::ResultType result = 0;
679 overflowed |= !safeMultiply(x, y, result);
682 return result;
685 template <typename U, typename V, typename OverflowHandler> static inline Checked<typename Result<U, V>::ResultType, OverflowHandler> operator+(Checked<U, OverflowHandler> lhs, V rhs)
690 template <typename U, typename V, typename OverflowHandler> static inline Checked<typename Result<U, V>::ResultType, OverflowHandler> operator-(Checked<U, OverflowHandler> lhs, V rhs)
695 template <typename U, typename V, typename OverflowHandler> static inline Checked<typename Result<U, V>::ResultType, OverflowHandler> operator*(Checked<U, OverflowHandler> lhs, V rhs)
700 template <typename U, typename V, typename OverflowHandler> static inline Checked<typename Result<U, V>::ResultType, OverflowHandler> operator+(U lhs, Checked<V, OverflowHandler> rhs)
705 template <typename U, typename V, typename OverflowHandler> static inline Checked<typename Result<U, V>::ResultType, OverflowHandler> operator-(U lhs, Checked<V, OverflowHandler> rhs)
710 template <typename U, typename V, typename OverflowHandler> static inline Checked<typename Result<U, V>::ResultType, OverflowHandler> operator*(U lhs, Checked<V, OverflowHandler> rhs)