mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05:00
AK: Make TypeBoundsChecker<UnsignedIntegralT, FloatingPointT> work
By replacing MakeUnsigned<Source> in this specific specialization with a simple negativity check this now works for floating point source types. Previously it would attempt a comparison of the destination type and void.
This commit is contained in:
parent
8f26f51580
commit
42b6bffbf2
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ template<typename Destination, typename Source>
|
||||||
struct TypeBoundsChecker<Destination, Source, false, false, true> {
|
struct TypeBoundsChecker<Destination, Source, false, false, true> {
|
||||||
static constexpr bool is_within_range(Source value)
|
static constexpr bool is_within_range(Source value)
|
||||||
{
|
{
|
||||||
return static_cast<MakeUnsigned<Source>>(value) <= NumericLimits<Destination>::max();
|
return value >= 0 && value <= NumericLimits<Destination>::max();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue