Browse Source

AK: Add helper to test for pointer and cv-pointer at the same time

Hendiadyoin1 3 years ago
parent
commit
ceb0e28ea5
1 changed files with 2 additions and 0 deletions
  1. 2 0
      AK/StdLibExtraDetails.h

+ 2 - 0
AK/StdLibExtraDetails.h

@@ -573,6 +573,8 @@ struct __decay<T[N]> {
 template<typename T>
 using Decay = typename __decay<T>::type;
 
+template<typename T, typename U>
+inline constexpr bool IsPointerOfType = IsPointer<Decay<U>>&& IsSame<T, RemoveCV<RemovePointer<Decay<U>>>>;
 }
 using AK::Detail::AddConst;
 using AK::Detail::AddLvalueReference;