AK: Add formatter for NonnullRefPtr<T>.

This commit is contained in:
asynts 2020-10-04 21:14:25 +02:00 committed by Andreas Kling
parent f4d0babd5d
commit 31feefff5e
Notes: sideshowbarker 2024-07-19 02:02:40 +09:00

View file

@ -248,6 +248,14 @@ inline const LogStream& operator<<(const LogStream& stream, const NonnullRefPtr<
return stream << value.ptr();
}
template<typename T>
struct Formatter<NonnullRefPtr<T>> : Formatter<const T*> {
void format(TypeErasedFormatParams& params, FormatBuilder& builder, const NonnullRefPtr<T>& value)
{
Formatter<const T*>::format(params, builder, value.ptr());
}
};
template<typename T, typename U>
inline void swap(NonnullRefPtr<T>& a, NonnullRefPtr<U>& b)
{