mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Add a formatter for OwnPtr<T>
This formatter just prints the object out as a pointer.
This commit is contained in:
committed by
Andreas Kling
parent
920f470735
commit
58fc901578
@@ -200,6 +200,13 @@ struct Traits<OwnPtr<T>> : public DefaultTraits<OwnPtr<T>> {
|
||||
static bool equals(OwnPtr<T> const& a, OwnPtr<T> const& b) { return a.ptr() == b.ptr(); }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct Formatter<OwnPtr<T>> : Formatter<T*> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, OwnPtr<T> const& value)
|
||||
{
|
||||
return Formatter<T*>::format(builder, value.ptr());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
|
||||
Reference in New Issue
Block a user