mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:47:35 +00:00
AK: Add ConstPeekType to Traits
Also, the PeekType of smart pointers is now T* instead of const T*. Note: This commit doesn't compile, it breaks HashMap::get() for some types. Fixed in the next commit.
This commit is contained in:
parent
77d462426b
commit
b816bd0806
4 changed files with 7 additions and 3 deletions
|
@ -158,7 +158,8 @@ make(Args&&... args)
|
|||
|
||||
template<typename T>
|
||||
struct Traits<NonnullOwnPtr<T>> : public GenericTraits<NonnullOwnPtr<T>> {
|
||||
using PeekType = const T*;
|
||||
using PeekType = T*;
|
||||
using ConstPeekType = const T*;
|
||||
static unsigned hash(const NonnullOwnPtr<T>& p) { return int_hash((u32)p.ptr()); }
|
||||
static bool equals(const NonnullOwnPtr<T>& a, const NonnullOwnPtr<T>& b) { return a.ptr() == b.ptr(); }
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue