• Home
  • Raw
  • Download

Lines Matching refs:Src

27 template <typename Dst, typename Src>
30 static constexpr Dst Do(Src) { in Do()
40 template <typename Dst, typename Src, typename Enable = void>
43 static constexpr bool Do(Src value) { in Do()
50 template <typename Dst, typename Src>
53 Src,
55 std::is_integral<Dst>::value && std::is_integral<Src>::value &&
56 std::is_signed<Dst>::value && std::is_signed<Src>::value &&
57 !IsTypeInRangeForNumericType<Dst, Src>::value>::type> {
60 static constexpr bool Do(Src value) {
68 template <typename Dst, typename Src>
71 Src,
73 std::is_integral<Dst>::value && std::is_integral<Src>::value &&
74 !std::is_signed<Dst>::value && std::is_signed<Src>::value &&
75 !IsTypeInRangeForNumericType<Dst, Src>::value>::type> {
78 static constexpr bool Do(Src value) {
81 return as_unsigned(value) <= as_unsigned(CommonMax<Src, Dst>());
87 template <typename Dst, typename Src>
88 constexpr bool IsValueInRangeForNumericType(Src value) {
89 using SrcType = typename internal::UnderlyingType<Src>::type;
103 typename Src>
104 constexpr Dst checked_cast(Src value) {
107 using SrcType = typename internal::UnderlyingType<Src>::type;
137 template <typename Dst, template <typename> class S, typename Src>
138 constexpr Dst saturated_cast_impl(Src value, RangeCheck constraint) {
145 : (std::is_integral<Src>::value || !constraint.IsUnderflowFlagSet()
153 template <typename Dst, typename Src, typename Enable = void>
156 static constexpr Dst Do(Src value) {
162 template <typename Dst, typename Src>
165 Src,
166 typename std::enable_if<std::is_integral<Src>::value &&
169 static Dst Do(Src value) {
170 if (SaturateFastAsmOp<Dst, Src>::is_supported)
171 return SaturateFastAsmOp<Dst, Src>::Do(value);
176 Dst saturated = CommonMaxOrMin<Dst, Src>(
177 IsMaxInRangeForNumericType<Dst, Src>() ||
178 (!IsMinInRangeForNumericType<Dst, Src>() && IsValueNegative(value)));
191 typename Src>
192 constexpr Dst saturated_cast(Src value) {
193 using SrcType = typename UnderlyingType<Src>::type;
208 template <typename Dst, typename Src>
209 constexpr Dst strict_cast(Src value) {
210 using SrcType = typename UnderlyingType<Src>::type;
211 static_assert(UnderlyingType<Src>::is_numeric, "Argument must be numeric.");
229 template <typename Dst, typename Src, class Enable = void>
234 template <typename Dst, typename Src>
237 Src,
239 ArithmeticOrUnderlyingEnum<Src>::value>::type> {
240 static const bool value = StaticDstRangeRelationToSrcRange<Dst, Src>::value ==
262 template <typename Src>
263 constexpr StrictNumeric(const StrictNumeric<Src>& rhs)
268 template <typename Src>
269 constexpr StrictNumeric(Src value) // NOLINT(runtime/explicit)