1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

AK+Format: Accept unsigned long in replacement fields.

I ran into this exact but at least twenty times in Serenity alone. The
C++ Standard dictates that 'unsigned long' and 'unsigned long long' are
distinct types even though on most platforms they are usually both 64
bit integers.

Also it wasn't possible to evaluate IsIntegral<T> for types that were
not integers since it used MakeUnsigned<T> internally.
This commit is contained in:
asynts 2020-12-20 17:00:50 +01:00 committed by Andreas Kling
parent cbe0a8b403
commit 620b73b3d5
3 changed files with 42 additions and 16 deletions

View file

@ -326,6 +326,7 @@ constexpr T&& forward(typename RemoveReference<T>::Type&& param) noexcept
template<typename T>
struct MakeUnsigned {
using Type = void;
};
template<>
struct MakeUnsigned<signed char> {
@ -507,6 +508,9 @@ using Void = void;
template<typename... _Ignored>
constexpr auto DependentFalse = false;
template<typename T>
using IsUnsigned = IsSame<T, MakeUnsigned<T>>;
}
using AK::AddConst;