mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-06 16:09:30 +00:00
AK: Add a couple more helper templates to StdLibExtras
This commit is contained in:
parent
a655cf5b41
commit
cd4bc81dbb
|
@ -98,6 +98,11 @@ struct EnableIf<true, T> {
|
|||
typedef T Type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct AddConst {
|
||||
typedef const T Type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct RemoveConst {
|
||||
typedef T Type;
|
||||
|
@ -416,6 +421,18 @@ struct MakeSigned<unsigned long long> {
|
|||
typedef long long type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct IsVoid : IsSame<void, typename RemoveCV<T>::Type> {
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct IsConst : FalseType {
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct IsConst<const T> : TrueType {
|
||||
};
|
||||
|
||||
template<typename T, typename U = T>
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue