1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:47:35 +00:00

AK: Add formatters for NonnullOwnPtr and WeakPtr.

This commit is contained in:
asynts 2020-10-15 15:24:01 +02:00 committed by Andreas Kling
parent 0508fdbbcd
commit 235622dc7f
2 changed files with 16 additions and 0 deletions

View file

@ -193,6 +193,14 @@ inline void swap(NonnullOwnPtr<T>& a, NonnullOwnPtr<U>& b)
a.swap(b);
}
template<typename T>
struct Formatter<NonnullOwnPtr<T>> : Formatter<const T*> {
void format(TypeErasedFormatParams& params, FormatBuilder& builder, const NonnullOwnPtr<T>& value)
{
Formatter<const T*>::format(params, builder, value.ptr());
}
};
}
using AK::adopt_own;