Lines Matching refs:Src
22 template <typename Dst, typename Src>
25 static constexpr Dst Do(Src) {
35 template <typename Dst, typename Src, typename Enable = void>
38 static constexpr bool Do(Src value) {
45 template <typename Dst, typename Src>
48 Src,
50 std::is_integral<Dst>::value && std::is_integral<Src>::value &&
51 std::is_signed<Dst>::value && std::is_signed<Src>::value &&
52 !IsTypeInRangeForNumericType<Dst, Src>::value>::type> {
55 static constexpr bool Do(Src value) {
63 template <typename Dst, typename Src>
66 Src,
68 std::is_integral<Dst>::value && std::is_integral<Src>::value &&
69 !std::is_signed<Dst>::value && std::is_signed<Src>::value &&
70 !IsTypeInRangeForNumericType<Dst, Src>::value>::type> {
73 static constexpr bool Do(Src value) {
76 return as_unsigned(value) <= as_unsigned(CommonMax<Src, Dst>());
82 template <typename Dst, typename Src>
83 constexpr bool IsValueInRangeForNumericType(Src value) {
84 using SrcType = typename internal::UnderlyingType<Src>::type;
98 typename Src>
99 constexpr Dst checked_cast(Src value) {
102 using SrcType = typename internal::UnderlyingType<Src>::type;
132 template <typename Dst, template <typename> class S, typename Src>
133 constexpr Dst saturated_cast_impl(Src value, RangeCheck constraint) {
139 // Skip this check for integral Src, which cannot be NaN.
140 : (std::is_integral<Src>::value || !constraint.IsUnderflowFlagSet()
148 template <typename Dst, typename Src, typename Enable = void>
151 static constexpr Dst Do(Src value) {
157 template <typename Dst, typename Src>
160 Src,
161 typename std::enable_if<std::is_integral<Src>::value &&
164 static Dst Do(Src value) {
165 if (SaturateFastAsmOp<Dst, Src>::is_supported)
166 return SaturateFastAsmOp<Dst, Src>::Do(value);
171 Dst saturated = CommonMaxOrMin<Dst, Src>(
172 IsMaxInRangeForNumericType<Dst, Src>() ||
173 (!IsMinInRangeForNumericType<Dst, Src>() && IsValueNegative(value)));
186 typename Src>
187 constexpr Dst saturated_cast(Src value) {
188 using SrcType = typename UnderlyingType<Src>::type;
203 template <typename Dst, typename Src>
204 constexpr Dst strict_cast(Src value) {
205 using SrcType = typename UnderlyingType<Src>::type;
206 static_assert(UnderlyingType<Src>::is_numeric, "Argument must be numeric.");
224 template <typename Dst, typename Src, class Enable = void>
229 template <typename Dst, typename Src>
232 Src,
234 ArithmeticOrUnderlyingEnum<Src>::value>::type> {
235 static const bool value = StaticDstRangeRelationToSrcRange<Dst, Src>::value ==
257 template <typename Src>
258 constexpr StrictNumeric(const StrictNumeric<Src>& rhs)
263 template <typename Src>
264 constexpr StrictNumeric(Src value) // NOLINT(runtime/explicit)