From 8b409d07c8ac1bce33c955759c23ebc66b7c5f14 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 21 Mar 2022 10:51:40 +1000 Subject: [PATCH] cmdotp2: silence some narrowing conversion warnings --- cmdopt2/parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmdopt2/parser.cpp b/cmdopt2/parser.cpp index 0f126abf..d3fbd0f6 100644 --- a/cmdopt2/parser.cpp +++ b/cmdopt2/parser.cpp @@ -207,13 +207,13 @@ parser::parse (int const argc, const char *const *argv) arg_cursor++; } - for (int i = 0, last = std::ssize (m_positional); i < last; ++i) + for (int i = 0, last = int (m_positional.size ()); i < last; ++i) if (m_positional[i].required () and !found_positional[i]) throw std::runtime_error ( fmt::format ("Missing required position argument {}", m_positional[i].name) ); - for (int i = 0, last = std::ssize (m_keyword); i < last; ++i) + for (int i = 0, last = int (m_keyword.size ()); i < last; ++i) if (m_keyword[i].required () and !found_keyword[i]) throw std::runtime_error ( fmt::format ("Missing required named argument {}", m_keyword[i].name)