Skip to content

Commit

Permalink
AK: Add IsArithmetic and IsFundamental type traits
Browse files Browse the repository at this point in the history
Also, make sure to using AK::IsNullPointer
  • Loading branch information
ADKaster authored and awesomekling committed Dec 30, 2020
1 parent 874df07 commit fe4b44b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions AK/StdLibExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,12 @@ constexpr auto DependentFalse = false;
template<typename T>
using IsUnsigned = IsSame<T, MakeUnsigned<T>>;

template<typename T>
using IsArithmetic = IntegralConstant<bool, IsIntegral<T>::value || IsFloatingPoint<T>::value>;

template<typename T>
using IsFundamental = IntegralConstant<bool, IsArithmetic<T>::value || IsVoid<T>::value || IsNullPointer<T>::value>;

}

using AK::AddConst;
Expand All @@ -524,9 +530,12 @@ using AK::exchange;
using AK::forward;
using AK::is_trivial;
using AK::is_trivially_copyable;
using AK::IsArithmetic;
using AK::IsBaseOf;
using AK::IsClass;
using AK::IsConst;
using AK::IsFundamental;
using AK::IsNullPointer;
using AK::IsSame;
using AK::IsUnion;
using AK::IsVoid;
Expand Down

0 comments on commit fe4b44b

Please sign in to comment.