Lines Matching refs:Dst

36 // A range for a given nunmeric Src type is contained for a given numeric Dst
37 // type if both numeric_limits<Src>::max() <= numeric_limits<Dst>::max() and
38 // numeric_limits<Src>::min() >= numeric_limits<Dst>::min() are true.
50 typename Dst,
52 IntegerRepresentation DstSign = std::numeric_limits<Dst>::is_signed
61 // Same sign: Dst is guaranteed to contain Src only if its range is equal or
63 template <typename Dst, typename Src, IntegerRepresentation Sign>
64 struct StaticDstRangeRelationToSrcRange<Dst, Src, Sign, Sign> {
66 MaxExponent<Dst>::value >= MaxExponent<Src>::value
71 // Unsigned to signed: Dst is guaranteed to contain source only if its range is
73 template <typename Dst, typename Src>
74 struct StaticDstRangeRelationToSrcRange<Dst,
79 MaxExponent<Dst>::value > MaxExponent<Src>::value
84 // Signed to unsigned: Dst cannot be statically determined to contain Src.
85 template <typename Dst, typename Src>
86 struct StaticDstRangeRelationToSrcRange<Dst,
117 typename Dst,
119 IntegerRepresentation DstSign = std::numeric_limits<Dst>::is_signed
126 StaticDstRangeRelationToSrcRange<Dst, Src>::value >
133 // Dst range is statically determined to contain Src: Nothing to check.
134 template <typename Dst,
138 struct DstRangeRelationToSrcRangeImpl<Dst,
148 template <typename Dst, typename Src>
149 struct DstRangeRelationToSrcRangeImpl<Dst,
155 return std::numeric_limits<Dst>::is_iec559
156 ? GetRangeConstraint(value <= std::numeric_limits<Dst>::max(),
157 value >= -std::numeric_limits<Dst>::max())
158 : GetRangeConstraint(value <= std::numeric_limits<Dst>::max(),
159 value >= std::numeric_limits<Dst>::min());
164 template <typename Dst, typename Src>
165 struct DstRangeRelationToSrcRangeImpl<Dst,
171 return GetRangeConstraint(value <= std::numeric_limits<Dst>::max(), true);
176 template <typename Dst, typename Src>
177 struct DstRangeRelationToSrcRangeImpl<Dst,
183 return sizeof(Dst) > sizeof(Src)
186 value <= static_cast<Src>(std::numeric_limits<Dst>::max()),
191 // Signed to unsigned: The upper boundary may be exceeded for a narrower Dst,
193 template <typename Dst, typename Src>
194 struct DstRangeRelationToSrcRangeImpl<Dst,
200 return (MaxExponent<Dst>::value >= MaxExponent<Src>::value)
203 value <= static_cast<Src>(std::numeric_limits<Dst>::max()),
208 template <typename Dst, typename Src>
212 STATIC_ASSERT(std::numeric_limits<Dst>::is_specialized);
213 return DstRangeRelationToSrcRangeImpl<Dst, Src>::Check(value);