mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:07:45 +00:00
AK: Add formatter for NonnullRefPtr<T>.
This commit is contained in:
parent
f4d0babd5d
commit
31feefff5e
1 changed files with 8 additions and 0 deletions
|
@ -248,6 +248,14 @@ inline const LogStream& operator<<(const LogStream& stream, const NonnullRefPtr<
|
||||||
return stream << value.ptr();
|
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>
|
template<typename T, typename U>
|
||||||
inline void swap(NonnullRefPtr<T>& a, NonnullRefPtr<U>& b)
|
inline void swap(NonnullRefPtr<T>& a, NonnullRefPtr<U>& b)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue