Multiply two unsigned integers, reporting overflow instead of wrapping.
Declared in <folly/lang/CheckedMath.h>
template<typename T>
requires std::is_unsigned_v<T>
bool
checked_mul(
T* result,
T a,
T b);
True on success; false on overflow, in which case *result is set to zero
| Name | Description |
|---|---|
| result | Out-param receiving the product on success |
| a | First factor |
| b | Second factor |