From cd4bc81dbb7237d61f4acf4dd2091d8b1b19b8be Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 24 Jul 2020 02:38:01 +0200 Subject: [PATCH] AK: Add a couple more helper templates to StdLibExtras --- AK/StdLibExtras.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index 27249af8b2..67c0f865a4 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -98,6 +98,11 @@ struct EnableIf { typedef T Type; }; +template +struct AddConst { + typedef const T Type; +}; + template struct RemoveConst { typedef T Type; @@ -416,6 +421,18 @@ struct MakeSigned { typedef long long type; }; +template +struct IsVoid : IsSame::Type> { +}; + +template +struct IsConst : FalseType { +}; + +template +struct IsConst : TrueType { +}; + template inline constexpr T exchange(T& slot, U&& value) { @@ -426,12 +443,15 @@ inline constexpr T exchange(T& slot, U&& value) } +using AK::AddConst; using AK::ceil_div; using AK::clamp; using AK::Conditional; using AK::exchange; using AK::forward; +using AK::IsConst; using AK::IsSame; +using AK::IsVoid; using AK::MakeSigned; using AK::MakeUnsigned; using AK::max;