Lines Matching refs:Dst

147 template <typename Dst,
149 IntegerRepresentation DstSign = std::is_signed<Dst>::value
159 template <typename Dst, typename Src, IntegerRepresentation Sign>
160 struct StaticDstRangeRelationToSrcRange<Dst, Src, Sign, Sign> {
162 MaxExponent<Dst>::value >= MaxExponent<Src>::value
169 template <typename Dst, typename Src>
170 struct StaticDstRangeRelationToSrcRange<Dst,
175 MaxExponent<Dst>::value > MaxExponent<Src>::value
181 template <typename Dst, typename Src>
182 struct StaticDstRangeRelationToSrcRange<Dst,
238 template <typename Dst, typename Src, template <typename> class Bounds>
241 using DstLimits = typename std::numeric_limits<Dst>;
245 (MaxExponent<Src>::value > MaxExponent<Dst>::value &&
256 static_assert(std::is_same<T, Dst>::value, "");
267 static_assert(std::is_same<T, Dst>::value, "");
272 static constexpr Dst max() { return Adjust(Bounds<Dst>::max()); }
273 static constexpr Dst lowest() { return Adjust(Bounds<Dst>::lowest()); }
276 template <typename Dst,
279 IntegerRepresentation DstSign = std::is_signed<Dst>::value
286 StaticDstRangeRelationToSrcRange<Dst, Src>::value>
294 template <typename Dst,
299 struct DstRangeRelationToSrcRangeImpl<Dst,
307 using DstLimits = NarrowingRange<Dst, Src, Bounds>;
309 static_cast<Dst>(SrcLimits::lowest()) >= DstLimits::lowest() ||
310 static_cast<Dst>(value) >= DstLimits::lowest(),
311 static_cast<Dst>(SrcLimits::max()) <= DstLimits::max() ||
312 static_cast<Dst>(value) <= DstLimits::max());
318 template <typename Dst, typename Src, template <typename> class Bounds>
319 struct DstRangeRelationToSrcRangeImpl<Dst,
326 using DstLimits = NarrowingRange<Dst, Src, Bounds>;
333 template <typename Dst, typename Src, template <typename> class Bounds>
334 struct DstRangeRelationToSrcRangeImpl<Dst,
341 using DstLimits = NarrowingRange<Dst, Src, Bounds>;
343 DstLimits::lowest() == Dst(0) || value >= DstLimits::lowest(),
349 template <typename Dst, typename Src, template <typename> class Bounds>
350 struct DstRangeRelationToSrcRangeImpl<Dst,
357 using DstLimits = NarrowingRange<Dst, Src, Bounds>;
358 using Promotion = decltype(Src() + Dst());
359 return RangeCheck(DstLimits::lowest() <= Dst(0) ||
369 template <typename Dst, typename Src, template <typename> class Bounds>
370 struct DstRangeRelationToSrcRangeImpl<Dst,
378 using DstLimits = NarrowingRange<Dst, Src, Bounds>;
379 using Promotion = decltype(Src() + Dst());
382 static_cast<Dst>(value) >= DstLimits::lowest()),
391 template <typename Dst, typename Src>
393 static const bool value = StaticDstRangeRelationToSrcRange<Dst, Src>::value ==
397 template <typename Dst,
402 static_assert(std::is_arithmetic<Dst>::value, "Result must be numeric.");
403 static_assert(Bounds<Dst>::lowest() < Bounds<Dst>::max(), "");
404 return DstRangeRelationToSrcRangeImpl<Dst, Src, Bounds>::Check(value);
813 template <typename Dst, typename Src>
815 return IsGreaterOrEqual<Dst, Src>::Test(std::numeric_limits<Dst>::max(),
819 template <typename Dst, typename Src>
821 return IsLessOrEqual<Dst, Src>::Test(std::numeric_limits<Dst>::lowest(),
825 template <typename Dst, typename Src>
826 constexpr Dst CommonMax() {
827 return !IsMaxInRangeForNumericType<Dst, Src>()
828 ? Dst(std::numeric_limits<Dst>::max())
829 : Dst(std::numeric_limits<Src>::max());
832 template <typename Dst, typename Src>
833 constexpr Dst CommonMin() {
834 return !IsMinInRangeForNumericType<Dst, Src>()
835 ? Dst(std::numeric_limits<Dst>::lowest())
836 : Dst(std::numeric_limits<Src>::lowest());
842 template <typename Dst, typename Src = Dst>
843 constexpr Dst CommonMaxOrMin(bool is_min) {
844 return is_min ? CommonMin<Dst, Src>() : CommonMax<Dst, Src>();