1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

AK: Add a OneOfIgnoringCV concept

Some functions want to ignore cv-qualifiers, and it's much easier to
constrain the type through a concept than a separate requires clause on
the function.
This commit is contained in:
Ali Mohammad Pur 2022-04-17 09:21:55 +04:30 committed by Ali Mohammad Pur
parent 5d1deac9a8
commit 2b79f36148
2 changed files with 12 additions and 0 deletions

View file

@ -593,6 +593,12 @@ inline constexpr bool IsHashCompatible<T, T> = true;
template<typename T, typename... Ts>
inline constexpr bool IsOneOf = (IsSame<T, Ts> || ...);
template<typename T, typename U>
inline constexpr bool IsSameIgnoringCV = IsSame<RemoveCV<T>, RemoveCV<U>>;
template<typename T, typename... Ts>
inline constexpr bool IsOneOfIgnoringCV = (IsSameIgnoringCV<T, Ts> || ...);
}
using AK::Detail::AddConst;
using AK::Detail::AddConstToReferencedType;
@ -630,10 +636,12 @@ using AK::Detail::IsMoveAssignable;
using AK::Detail::IsMoveConstructible;
using AK::Detail::IsNullPointer;
using AK::Detail::IsOneOf;
using AK::Detail::IsOneOfIgnoringCV;
using AK::Detail::IsPOD;
using AK::Detail::IsPointer;
using AK::Detail::IsRvalueReference;
using AK::Detail::IsSame;
using AK::Detail::IsSameIgnoringCV;
using AK::Detail::IsSigned;
using AK::Detail::IsSpecializationOf;
using AK::Detail::IsTrivial;