mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 03:36:36 +00:00
LibGC: Make GC::Root formattable
This commit is contained in:
parent
06d62e5b5a
commit
6d2f393f2b
Notes:
github-actions[bot]
2025-05-01 16:17:06 +00:00
Author: https://github.com/AtkinsSJ
Commit: 6d2f393f2b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4456
Reviewed-by: https://github.com/awesomekling
1 changed files with 8 additions and 0 deletions
|
@ -170,6 +170,14 @@ struct Traits<GC::Root<T>> : public DefaultTraits<GC::Root<T>> {
|
|||
static unsigned hash(GC::Root<T> const& handle) { return Traits<T>::hash(handle); }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct Formatter<GC::Root<T>> : Formatter<T const*> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, GC::Root<T> const& value)
|
||||
{
|
||||
return Formatter<T const*>::format(builder, value.ptr());
|
||||
}
|
||||
};
|
||||
|
||||
namespace Detail {
|
||||
template<typename T>
|
||||
inline constexpr bool IsHashCompatible<GC::Root<T>, T> = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue