From 744bff33f4e4e5c35da661d04f1011fd8e8f41b0 Mon Sep 17 00:00:00 2001 From: Yancey <135342560+Yancey2023@users.noreply.github.com> Date: Wed, 4 Mar 2026 07:17:05 +0800 Subject: [PATCH] add static assertion to prevent lossy type conversion --- include/fmt/base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 795dacf6..2228a270 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -1808,7 +1808,7 @@ template class buffer { /// Appends data to the end of the buffer. template FMT_CONSTEXPR20 void append(const U* begin, const U* end) { - static_assert(std::is_same::value || std::is_same::value); + static_assert(std::is_same::value || std::is_same::value, ""); while (begin != end) { auto size = size_; auto free_cap = capacity_ - size;