diff --git a/AK/IntrusiveRedBlackTree.h b/AK/IntrusiveRedBlackTree.h index 8d372b30e74..6190f6b27a5 100644 --- a/AK/IntrusiveRedBlackTree.h +++ b/AK/IntrusiveRedBlackTree.h @@ -52,7 +52,7 @@ public: { auto& node = value.*member; VERIFY(!node.m_in_tree); - node.key = key; + static_cast(node).key = key; BaseTree::insert(&node); if constexpr (!TreeNode::IsRaw) node.m_self.reference = &value; // Note: Self-reference ensures that the object will keep a ref to itself when the Container is a smart pointer. @@ -176,6 +176,11 @@ public: return m_in_tree; } + [[nodiscard]] K key() const + { + return BaseRedBlackTree::Node::key; + } + static constexpr bool IsRaw = IsPointer; #ifndef __clang__