From 99063348e328b2dffea4dc094092599dbcfbbb68 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Fri, 14 Aug 2026 16:35:07 +0300 Subject: [PATCH] Add util::fixed_point formatter --- libs/util/include/psemek/util/fixed_point.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libs/util/include/psemek/util/fixed_point.hpp b/libs/util/include/psemek/util/fixed_point.hpp index b632135f..021ea4dd 100644 --- a/libs/util/include/psemek/util/fixed_point.hpp +++ b/libs/util/include/psemek/util/fixed_point.hpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace psemek::util { @@ -455,3 +456,21 @@ namespace psemek::util } } + +namespace std +{ + + template + struct formatter<::psemek::util::fixed_point, Char> + : formatter + { + using base = formatter; + + template + auto format(::psemek::util::fixed_point const & fp, FormatContext & ctx) const + { + return base::format(static_cast(fp), ctx); + } + }; + +}