Skip to content

Commit

Permalink
Added cast to prevent error with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
timohl committed Jan 10, 2025
1 parent 4e49c81 commit bbb0ca7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/typing.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ consteval auto sanitize_string_literal() {
constexpr std::string_view v(StrLit.name);
constexpr std::string_view special_chars("!@%{}-");
constexpr auto num_special_chars = std::accumulate(
special_chars.begin(), special_chars.end(), 0, [&v](auto acc, const char &c) {
special_chars.begin(), special_chars.end(), (size_t) 0, [&v](auto acc, const char &c) {
return std::move(acc) + std::ranges::count(v, c);
});
char result[v.size() + num_special_chars + 1];
Expand Down

0 comments on commit bbb0ca7

Please sign in to comment.