From 31feefff5e8b1360f440b7383792ddd08d6f2316 Mon Sep 17 00:00:00 2001 From: asynts Date: Sun, 4 Oct 2020 21:14:25 +0200 Subject: [PATCH] AK: Add formatter for NonnullRefPtr. --- AK/NonnullRefPtr.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h index b7cba8f1b6..22c61b2f86 100644 --- a/AK/NonnullRefPtr.h +++ b/AK/NonnullRefPtr.h @@ -248,6 +248,14 @@ inline const LogStream& operator<<(const LogStream& stream, const NonnullRefPtr< return stream << value.ptr(); } +template +struct Formatter> : Formatter { + void format(TypeErasedFormatParams& params, FormatBuilder& builder, const NonnullRefPtr& value) + { + Formatter::format(params, builder, value.ptr()); + } +}; + template inline void swap(NonnullRefPtr& a, NonnullRefPtr& b) {