| 8 | { |
| 9 | template<typename T> |
| 10 | bool SafeAdd(T a, T b, T& out) |
| 11 | { |
| 12 | if (std::is_unsigned<T>::value || true) |
| 13 | { |
| 14 | if (b > std::numeric_limits<T>::max() - a) |
| 15 | { |
| 16 | return false; |
| 17 | } |
| 18 | } |
| 19 | out = a + b; |
| 20 | return true; |
| 21 | } |
| 22 | |
| 23 | template<typename T> |
| 24 | bool SafeMultiply(T a, T b, T& out) |
nothing calls this directly
no outgoing calls
no test coverage detected