mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05:00
AK: Add Formatter for RefPtr
This commit is contained in:
parent
07564577c0
commit
4d30166d61
1 changed files with 8 additions and 0 deletions
|
@ -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*;
|
||||
|
|
Loading…
Reference in a new issue