Browse Source

AK: Add is_trivial and is_trivially_copyable

Tom 4 years ago
parent
commit
bb92eab9ce
1 changed files with 14 additions and 0 deletions
  1. 14 0
      AK/StdLibExtras.h

+ 14 - 0
AK/StdLibExtras.h

@@ -452,6 +452,18 @@ template<typename Base, typename Derived>
 struct IsBaseOf : public IntegralConstant<bool, __is_base_of(Base, Derived)> {
 };
 
+template<typename T>
+constexpr bool is_trivial()
+{
+    return __is_trivial(T);
+}
+
+template<typename T>
+constexpr bool is_trivially_copyable()
+{
+    return __is_trivially_copyable(T);
+}
+
 template<typename T>
 struct __IsIntegral : FalseType {
 };
@@ -502,6 +514,8 @@ using AK::Conditional;
 using AK::declval;
 using AK::exchange;
 using AK::forward;
+using AK::is_trivial;
+using AK::is_trivially_copyable;
 using AK::IsBaseOf;
 using AK::IsClass;
 using AK::IsConst;