Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
base::internal::DstRangeRelationToSrcRangeImpl< Dst, Src, Bounds, DstSign, SrcSign, NUMERIC_RANGE_CONTAINED > Struct Template Reference

#include <safe_conversions_impl.h>

Static Public Member Functions

static constexpr RangeCheck Check (Src value)
 

Detailed Description

template<typename Dst, typename Src, template< typename > class Bounds, IntegerRepresentation DstSign, IntegerRepresentation SrcSign>
struct base::internal::DstRangeRelationToSrcRangeImpl< Dst, Src, Bounds, DstSign, SrcSign, NUMERIC_RANGE_CONTAINED >

Definition at line 301 of file safe_conversions_impl.h.

Member Function Documentation

◆ Check()

template<typename Dst , typename Src , template< typename > class Bounds, IntegerRepresentation DstSign, IntegerRepresentation SrcSign>
static constexpr RangeCheck base::internal::DstRangeRelationToSrcRangeImpl< Dst, Src, Bounds, DstSign, SrcSign, NUMERIC_RANGE_CONTAINED >::Check ( Src  value)
inlinestaticconstexpr

Definition at line 307 of file safe_conversions_impl.h.

307 {
308 using SrcLimits = std::numeric_limits<Src>;
309 using DstLimits = NarrowingRange<Dst, Src, Bounds>;
310 return RangeCheck(
311 static_cast<Dst>(SrcLimits::lowest()) >= DstLimits::lowest() ||
312 static_cast<Dst>(value) >= DstLimits::lowest(),
313 static_cast<Dst>(SrcLimits::max()) <= DstLimits::max() ||
314 static_cast<Dst>(value) <= DstLimits::max());
315 }

The documentation for this struct was generated from the following file: