1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 02:57:44 +00:00

AK: Add formatter for pointer types.

This commit is contained in:
asynts 2020-09-30 14:38:47 +02:00 committed by Andreas Kling
parent ebafc5b4d2
commit fb7a94c959
3 changed files with 41 additions and 1 deletions

View file

@ -198,6 +198,15 @@ struct Formatter<T, typename EnableIf<IsIntegral<T>::value>::Type> : StandardFor
void format(StringBuilder&, T value, FormatterContext&);
};
template<typename T>
struct Formatter<T*> : StandardFormatter {
void format(StringBuilder& builder, T* value, FormatterContext& context)
{
Formatter<FlatPtr> formatter { *this };
formatter.format(builder, reinterpret_cast<FlatPtr>(value), context);
}
};
template<>
struct Formatter<bool> : StandardFormatter {
void format(StringBuilder&, bool value, FormatterContext&);