diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index 99405847a72..5fa314b927f 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -158,7 +158,8 @@ make(Args&&... args) template struct Traits> : public GenericTraits> { - using PeekType = const T*; + using PeekType = T*; + using ConstPeekType = const T*; static unsigned hash(const NonnullOwnPtr& p) { return int_hash((u32)p.ptr()); } static bool equals(const NonnullOwnPtr& a, const NonnullOwnPtr& b) { return a.ptr() == b.ptr(); } }; diff --git a/AK/OwnPtr.h b/AK/OwnPtr.h index 2ace9a4cea1..416af312e2b 100644 --- a/AK/OwnPtr.h +++ b/AK/OwnPtr.h @@ -193,7 +193,8 @@ inline void swap(OwnPtr& a, OwnPtr& b) template struct Traits> : public GenericTraits> { - using PeekType = const T*; + using PeekType = T*; + using ConstPeekType = const T*; static unsigned hash(const OwnPtr& p) { return ptr_hash(p.ptr()); } static bool equals(const OwnPtr& a, const OwnPtr& b) { return a.ptr() == b.ptr(); } }; diff --git a/AK/RefPtr.h b/AK/RefPtr.h index e85ba1c93d4..687641836a4 100644 --- a/AK/RefPtr.h +++ b/AK/RefPtr.h @@ -451,7 +451,8 @@ struct Formatter> : Formatter { template struct Traits> : public GenericTraits> { - using PeekType = const T*; + using PeekType = T*; + using ConstPeekType = const T*; static unsigned hash(const RefPtr& p) { return ptr_hash(p.ptr()); } static bool equals(const RefPtr& a, const RefPtr& b) { return a.ptr() == b.ptr(); } }; diff --git a/AK/Traits.h b/AK/Traits.h index aa0630c32ab..19cc078122f 100644 --- a/AK/Traits.h +++ b/AK/Traits.h @@ -14,6 +14,7 @@ namespace AK { template struct GenericTraits { using PeekType = T; + using ConstPeekType = T; static constexpr bool is_trivial() { return false; } static constexpr bool equals(const T& a, const T& b) { return a == b; } };