From 085aae0e497872c9bbcd63c25a6bd32c74ab5710 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Fri, 12 Sep 2025 23:27:09 +0800 Subject: Fix ImplementFormatterByToUtf8String. --- include/cru/base/Format.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/cru/base/Format.h b/include/cru/base/Format.h index 83fda3f1..2d95b2fd 100644 --- a/include/cru/base/Format.h +++ b/include/cru/base/Format.h @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -156,7 +157,12 @@ template struct ImplementFormatterByToUtf8String { template constexpr ParseContext::iterator parse(ParseContext& ctx) const { - return ctx.end(); + auto iter = ctx.begin(); + if (*iter != '}') { + throw std::format_error( + "ImplementFormatterByToUtf8String does not accept format args."); + } + return iter; } template -- cgit v1.2.3