From b7a02c73c6fc95f6a700880bea8f625124b3f7b9 Mon Sep 17 00:00:00 2001 From: Yuriy Chernyshov Date: Sun, 2 Mar 2025 19:25:11 +0100 Subject: [PATCH] Fix build when iterators are raw pointers `typename Iterator` might be just a raw pointer. The most correct way would be using `std::iterator_traits` to get the type properly, but it seems that current static_cast can be simply removed. --- include/argparse/argparse.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/argparse/argparse.hpp b/include/argparse/argparse.hpp index 06d30fd4..52264778 100644 --- a/include/argparse/argparse.hpp +++ b/include/argparse/argparse.hpp @@ -1028,8 +1028,7 @@ class Argument { if ((dist = static_cast(std::distance(start, end))) >= num_args_min) { if (num_args_max < dist) { - end = std::next(start, static_cast( - num_args_max)); + end = std::next(start, num_args_max); } if (!m_accepts_optional_like_value) { end = std::find_if(