Index: base/numerics/safe_math.h |
diff --git a/base/numerics/safe_math.h b/base/numerics/safe_math.h |
index 1309446e195a73c960114c12fba2fd328de1525b..1fab032af0f449d825282b1c90307f231837985f 100644 |
--- a/base/numerics/safe_math.h |
+++ b/base/numerics/safe_math.h |
@@ -66,6 +66,13 @@ class CheckedNumeric { |
"Argument must be numeric."); |
} |
+ // This is not an explicit constructor because we want a seamless conversion |
+ // from StrictNumeric types. |
+ template <typename Src> |
+ CheckedNumeric(StrictNumeric<Src> value) |
+ : state_(static_cast<Src>(value)) { |
+ } |
+ |
// IsValid() is the public API to test if a CheckedNumeric is currently valid. |
bool IsValid() const { return validity() == RANGE_VALID; } |