From 58fc901578419a97b45b64edcac48ce387d6021f 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 98246375b3..1b4764d9ce 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