Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix narrowing conversion warning in struct fstring #4210

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -2634,12 +2634,14 @@ inline auto runtime(string_view s) -> runtime_format_string<> { return {{s}}; }
/// A compile-time format string.
template <typename... T> struct fstring {
private:
static constexpr int num_static_named_args =
static constexpr size_t num_static_named_args =
detail::count_static_named_args<T...>();

using checker = detail::format_string_checker<
char, static_cast<int>(sizeof...(T)), num_static_named_args,
num_static_named_args != detail::count_named_args<T...>()>;
using checker =
detail::format_string_checker<char, static_cast<int>(sizeof...(T)),
static_cast<int>(num_static_named_args),
num_static_named_args !=
detail::count_named_args<T...>()>;

using arg_pack = detail::arg_pack<T...>;

Expand Down