From 6edf5653a542ac8f14893e2091af30405941f00b Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Tue, 4 Jun 2024 13:40:17 +0200 Subject: [PATCH] AK: Add a formatter for OwnPtr This formatter just prints the object out as a pointer. --- AK/OwnPtr.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/AK/OwnPtr.h b/AK/OwnPtr.h index 98246375b35..1b4764d9ce8 100644 --- a/AK/OwnPtr.h +++ b/AK/OwnPtr.h @@ -200,6 +200,13 @@ struct Traits> : public DefaultTraits> { static bool equals(OwnPtr const& a, OwnPtr const& b) { return a.ptr() == b.ptr(); } }; +template +struct Formatter> : Formatter { + ErrorOr format(FormatBuilder& builder, OwnPtr const& value) + { + return Formatter::format(builder, value.ptr()); + } +}; } #if USING_AK_GLOBALLY