• Home
  • Raw
  • Download

Lines Matching refs:Dst

52 template <typename Dst, typename Src>
54 return internal::DstRangeRelationToSrcRange<Dst>(value).IsValid(); in IsValueInRangeForNumericType()
73 template <typename Dst,
76 constexpr Dst checked_cast(Src value) { in checked_cast()
80 return IsValueInRangeForNumericType<Dst, SrcType>(value) in checked_cast()
81 ? static_cast<Dst>(static_cast<SrcType>(value)) in checked_cast()
82 : CheckHandler::template HandleFailure<Dst>(); in checked_cast()
109 template <typename Dst, template <typename> class S, typename Src>
110 constexpr Dst saturated_cast_impl(Src value, RangeCheck constraint) { in saturated_cast_impl()
114 ? (!constraint.IsUnderflowFlagSet() ? static_cast<Dst>(value) in saturated_cast_impl()
115 : S<Dst>::Underflow()) in saturated_cast_impl()
118 ? S<Dst>::Overflow() in saturated_cast_impl()
119 : S<Dst>::NaN()); in saturated_cast_impl()
126 template <typename Dst,
130 constexpr Dst saturated_cast(Src value) { in saturated_cast()
132 return saturated_cast_impl<Dst, SaturationHandler, SrcType>( in saturated_cast()
134 DstRangeRelationToSrcRange<Dst, SaturationHandler, SrcType>(value)); in saturated_cast()
140 template <typename Dst, typename Src>
141 constexpr Dst strict_cast(Src value) { in strict_cast()
144 static_assert(std::is_arithmetic<Dst>::value, "Result must be numeric."); in strict_cast()
152 static_assert(StaticDstRangeRelationToSrcRange<Dst, SrcType>::value == in strict_cast()
157 return static_cast<Dst>(static_cast<SrcType>(value)); in strict_cast()
161 template <typename Dst, typename Src, class Enable = void>
166 template <typename Dst, typename Src>
168 Dst,
170 typename std::enable_if<ArithmeticOrUnderlyingEnum<Dst>::value &&
172 static const bool value = StaticDstRangeRelationToSrcRange<Dst, Src>::value ==
216 template <typename Dst,
218 IsNumericRangeContained<Dst, T>::value>::type* = nullptr>
219 constexpr operator Dst() const {
220 return static_cast<typename ArithmeticOrUnderlyingEnum<Dst>::type>(value_);