aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/cru/base/Format.h8
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>