mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09: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
Notes:
sideshowbarker
2024-07-18 08:33:35 +09:00
Author: https://github.com/linusg
Commit: 42b6bffbf2
Pull-request: https://github.com/SerenityOS/serenity/pull/8940
Reviewed-by: https://github.com/IdanHo ✅
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…
Add table
Add a link
Reference in a new issue