mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Add formatter for NonnullRefPtr<T>.
This commit is contained in:
parent
f4d0babd5d
commit
31feefff5e
Notes:
sideshowbarker
2024-07-19 02:02:40 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/31feefff5e8 Pull-request: https://github.com/SerenityOS/serenity/pull/3684
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();
|
||||
}
|
||||
|
||||
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>
|
||||
inline void swap(NonnullRefPtr<T>& a, NonnullRefPtr<U>& b)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue