mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Add a formatter for OwnPtr<T>
This formatter just prints the object out as a pointer.
This commit is contained in:
parent
920f470735
commit
58fc901578
Notes:
sideshowbarker
2024-07-17 07:38:17 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/LadybirdBrowser/ladybird/commit/58fc901578 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/213 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/awesomekling
1 changed files with 7 additions and 0 deletions
|
@ -200,6 +200,13 @@ struct Traits<OwnPtr<T>> : public DefaultTraits<OwnPtr<T>> {
|
|||
static bool equals(OwnPtr<T> const& a, OwnPtr<T> const& b) { return a.ptr() == b.ptr(); }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct Formatter<OwnPtr<T>> : Formatter<T*> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, OwnPtr<T> const& value)
|
||||
{
|
||||
return Formatter<T*>::format(builder, value.ptr());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
|
|
Loading…
Reference in a new issue