diff --git a/AK/Concepts.h b/AK/Concepts.h index 2996e43633b..00580face5f 100644 --- a/AK/Concepts.h +++ b/AK/Concepts.h @@ -36,6 +36,9 @@ concept SameAs = IsSame; template concept AnyString = Detail::IsConstructible; +template +concept HashCompatible = IsHashCompatible, Detail::Decay>; + // FIXME: remove once Clang formats these properly. // clang-format off template diff --git a/AK/StdLibExtraDetails.h b/AK/StdLibExtraDetails.h index 0235022f04a..1b91e337516 100644 --- a/AK/StdLibExtraDetails.h +++ b/AK/StdLibExtraDetails.h @@ -575,6 +575,12 @@ using Decay = typename __decay::type; template inline constexpr bool IsPointerOfType = IsPointer>&& IsSame>>>; + +template +inline constexpr bool IsHashCompatible = false; +template +inline constexpr bool IsHashCompatible = true; + } using AK::Detail::AddConst; using AK::Detail::AddLvalueReference; @@ -605,6 +611,7 @@ using AK::Detail::IsEnum; using AK::Detail::IsFloatingPoint; using AK::Detail::IsFunction; using AK::Detail::IsFundamental; +using AK::Detail::IsHashCompatible; using AK::Detail::IsIntegral; using AK::Detail::IsLvalueReference; using AK::Detail::IsMoveAssignable; diff --git a/AK/StringUtils.h b/AK/StringUtils.h index 13794c4d0c9..ca079cb82ad 100644 --- a/AK/StringUtils.h +++ b/AK/StringUtils.h @@ -7,10 +7,16 @@ #pragma once +#include #include namespace AK { +namespace Detail { +template +inline constexpr bool IsHashCompatible = true; +} + enum class CaseSensitivity { CaseInsensitive, CaseSensitive,