Skip to content

Commit

Permalink
Fix build when iterators are raw pointers
Browse files Browse the repository at this point in the history
Similar to #11879, `typename Iterator` might be just a raw pointer.
The most corrent way would be using `std::iterator_traits` to get the type properly, but it seems that current static_cast can be simply removed.
  • Loading branch information
georgthegreat authored Feb 22, 2025
1 parent 26fc9a3 commit 96377c2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,7 @@ class Argument {
if ((dist = static_cast<std::size_t>(std::distance(start, end))) >=
num_args_min) {
if (num_args_max < dist) {
end = std::next(start, static_cast<typename Iterator::difference_type>(
num_args_max));
end = std::next(start, num_args_max));
}
if (!m_accepts_optional_like_value) {
end = std::find_if(
Expand Down

0 comments on commit 96377c2

Please sign in to comment.