| 60 | // Add 'a' and 'b', and set *overflowed to true if overflow occured. |
| 61 | template<typename Type> |
| 62 | inline Type AddWithOverflowCheck(Type a, Type b, bool *overflowed) { |
| 63 | // Pick the right specialization based on whether Type is signed. |
| 64 | typedef safe_math_internal::WithOverflowCheck<Type, MathLimits<Type>::kIsSigned> my_struct; |
| 65 | return my_struct::Add(a, b, overflowed); |
| 66 | } |
| 67 | |
| 68 | } // namespace kudu |
| 69 | #endif |