AK: Add Formatter for RefPtr

This commit is contained in:
Andreas Kling 2021-03-09 21:30:07 +01:00
parent 07564577c0
commit 4d30166d61

View file

@ -467,6 +467,14 @@ inline const LogStream& operator<<(const LogStream& stream, const RefPtr<T, PtrT
return stream << value.ptr();
}
template<typename T>
struct Formatter<RefPtr<T>> : Formatter<const T*> {
void format(FormatBuilder& builder, const RefPtr<T>& value)
{
Formatter<const T*>::format(builder, value.ptr());
}
};
template<typename T>
struct Traits<RefPtr<T>> : public GenericTraits<RefPtr<T>> {
using PeekType = const T*;