Skip to content

Commit

Permalink
Use const_check to silence MSVC warning
Browse files Browse the repository at this point in the history
The condition is constexpr, so the compiler warns if a runtime check
is used as there's no need to generate code for it.
  • Loading branch information
danakj committed May 31, 2023
1 parent 414cba9 commit e27be85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ class format_arg_store
basic_format_args<Context>(*this),
#endif
data_{detail::make_arg<is_packed, Context>(args)...} {
if (num_named_args != 0)
if (detail::const_check(num_named_args != 0))
detail::init_named_args(data_.named_args(), 0, 0, args...);
}
};
Expand Down

0 comments on commit e27be85

Please sign in to comment.