Home | History | Annotate | Download | only in wtf

Lines Matching refs:ResultType

195     typedef U ResultType;
199 typedef V ResultType;
203 typedef U ResultType;
208 typedef U ResultType;
212 typedef U ResultType;
216 typedef V ResultType;
220 typedef U ResultType;
224 typedef typename SignednessSelector<U, V>::ResultType ResultType;
230 template <typename LHS, typename RHS, typename ResultType = typename Result<LHS, RHS>::ResultType,
233 template <typename LHS, typename RHS, typename ResultType> struct ArithmeticOperations<LHS, RHS, ResultType, true, true> {
242 static inline bool add(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
246 if ((std::numeric_limits<ResultType>::max() - rhs) < lhs)
249 ResultType temp = lhs - std::numeric_limits<ResultType>::min();
258 static inline bool sub(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
262 if (lhs > std::numeric_limits<ResultType>::max() + rhs)
265 if (rhs > std::numeric_limits<ResultType>::max() + lhs)
273 static inline bool multiply(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
277 if (lhs && (std::numeric_limits<ResultType>::max() / lhs) < rhs)
280 if (static_cast<ResultType>(lhs) == std::numeric_limits<ResultType>::min() || static_cast<ResultType>(rhs) == std::numeric_limits<ResultType>::min())
282 if ((std::numeric_limits<ResultType>::max() / -lhs) < -rhs)
287 if (rhs && lhs < (std::numeric_limits<ResultType>::min() / rhs))
290 if (lhs && rhs < (std::numeric_limits<ResultType>::min() / lhs))
302 template <typename LHS, typename RHS, typename ResultType> struct ArithmeticOperations<LHS, RHS, ResultType, false, false> {
304 static inline bool add(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
306 ResultType temp = lhs + rhs;
313 static inline bool sub(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
315 ResultType temp = lhs - rhs;
322 static inline bool multiply(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN
328 if (std::numeric_limits<ResultType>::max() / lhs < rhs)
338 template <typename ResultType> struct ArithmeticOperations<int, unsigned, ResultType, true, false> {
339 static inline bool add(int64_t lhs, int64_t rhs, ResultType& result)
342 if (temp < std::numeric_limits<ResultType>::min())
344 if (temp > std::numeric_limits<ResultType>::max())
346 result = static_cast<ResultType>(temp);
350 static inline bool sub(int64_t lhs, int64_t rhs, ResultType& result)
353 if (temp < std::numeric_limits<ResultType>::min())
355 if (temp > std::numeric_limits<ResultType>::max())
357 result = static_cast<ResultType>(temp);
361 static inline bool multiply(int64_t lhs, int64_t rhs, ResultType& result)
364 if (temp < std::numeric_limits<ResultType>::min())
366 if (temp > std::numeric_limits<ResultType>::max())
368 result = static_cast<ResultType>(temp);
378 template <typename ResultType> struct ArithmeticOperations<unsigned, int, ResultType, false, true> {
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);
396 return ArithmeticOperations<int, unsigned, ResultType>::equals(rhs, lhs);
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;
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;
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;
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)