8 #ifndef V8_BASE_SAFE_CONVERSIONS_H_
9 #define V8_BASE_SAFE_CONVERSIONS_H_
20 template <
typename Dst,
typename Src>
22 return internal::DstRangeRelationToSrcRange<Dst>(value) ==
29 template <
typename Dst,
typename Src>
31 CHECK(IsValueInRangeForNumericType<Dst>(value));
32 return static_cast<Dst
>(value);
38 template <
typename Dst,
typename Src>
41 if (std::numeric_limits<Dst>::is_iec559)
42 return static_cast<Dst
>(value);
44 switch (internal::DstRangeRelationToSrcRange<Dst>(value)) {
46 return static_cast<Dst
>(value);
52 return std::numeric_limits<Dst>::max();
57 return std::numeric_limits<Dst>::max();
61 return static_cast<Dst
>(value);
bool IsValueInRangeForNumericType(Src value)
Dst checked_cast(Src value)
Dst saturated_cast(Src value)
static int min(int a, int b)
Debugger support for the V8 JavaScript engine.