From 05c3755e62f5d83dd1a7f5bd8f4b5496fdc6aa1f Mon Sep 17 00:00:00 2001 From: sin-ack Date: Fri, 30 Jul 2021 20:14:06 +0000 Subject: [PATCH] AK: Add formatters for BigEndian and LittleEndian This allows printing out BigEndian and LittleEndian values without having to perform a static_cast first. --- AK/Endian.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AK/Endian.h b/AK/Endian.h index 549e4f4869..adf3d82257 100644 --- a/AK/Endian.h +++ b/AK/Endian.h @@ -6,6 +6,7 @@ #pragma once +#include #include #include @@ -134,6 +135,14 @@ private: template using NetworkOrdered = BigEndian; +template +requires(HasFormatter) struct Formatter> : Formatter { +}; + +template +requires(HasFormatter) struct Formatter> : Formatter { +}; + } using AK::BigEndian;