From 5e1b85fdc56487ff7e8c68d1cca08561fc2bb44d Mon Sep 17 00:00:00 2001 From: Jack Clarke Date: Sun, 12 May 2019 17:38:18 +0100 Subject: [PATCH] fix warning for implicit type conversion --- include/argparse.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/argparse.hpp b/include/argparse.hpp index 4910c9a..b4408ef 100644 --- a/include/argparse.hpp +++ b/include/argparse.hpp @@ -626,7 +626,7 @@ class ArgumentParser { std::vector argumentLengths(aArguments.size()); std::transform(std::begin(aArguments), std::end(aArguments), std::begin(argumentLengths), [](const auto& arg) { const auto& names = arg->mNames; - auto maxLength = std::accumulate(std::begin(names), std::end(names), 0, [](const auto& sum, const auto& s) { + auto maxLength = std::accumulate(std::begin(names), std::end(names), std::string::size_type{0}, [](const auto& sum, const auto& s) { return sum + s.size() + 2; // +2 for ", " }); return maxLength - 2; // -2 since the last one doesn't need ", "