From c368d5e98b634e3df35c34d9ebbabc880c104f6c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 9 May 2020 18:22:14 -0700 Subject: [PATCH] [clang-tidy] use const references Found with readability-qualified-auto Signed-off-by: Rosen Penev --- include/cxxopts.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index c8a40bf..088c7a5 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -1462,8 +1462,8 @@ namespace cxxopts const HelpOptionDetails& o ) { - auto& s = o.s; - auto& l = o.l; + const auto& s = o.s; + const auto& l = o.l; String result = " "; @@ -1933,7 +1933,7 @@ ParseResult::parse(int& argc, char**& argv) for (auto& opt : *m_options) { auto& detail = opt.second; - auto& value = detail->value(); + const auto& value = detail->value(); auto& store = m_results[detail]; @@ -2130,7 +2130,7 @@ Options::generate_all_groups_help(String& result) const std::vector all_groups; all_groups.reserve(m_help.size()); - for (auto& group : m_help) + for (const auto& group : m_help) { all_groups.push_back(group.first); }