mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Add Formatter for RefPtr
This commit is contained in:
parent
07564577c0
commit
4d30166d61
Notes:
sideshowbarker
2024-07-18 21:33:43 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4d30166d615
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