diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-09-12 23:27:09 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-09-15 03:15:56 +0800 |
commit | 085aae0e497872c9bbcd63c25a6bd32c74ab5710 (patch) | |
tree | 943dfa5e50071e0895bbae90363b2b944332566d | |
parent | 47e133ab64f396b63d89d95f26874a54a0dfc1e5 (diff) | |
download | cru-085aae0e497872c9bbcd63c25a6bd32c74ab5710.tar.gz cru-085aae0e497872c9bbcd63c25a6bd32c74ab5710.tar.bz2 cru-085aae0e497872c9bbcd63c25a6bd32c74ab5710.zip |
Fix ImplementFormatterByToUtf8String.
-rw-r--r-- | include/cru/base/Format.h | 8 |
1 files changed, 7 insertions, 1 deletions
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 <cassert> #include <cstdio> +#include <format> #include <type_traits> #include <vector> @@ -156,7 +157,12 @@ template <typename T> struct ImplementFormatterByToUtf8String { template <class ParseContext> 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 <class FmtContext> |