Skip to content

Commit

Permalink
Rename inner scope variables to differ from outer scope
Browse files Browse the repository at this point in the history
These variables with the same name are not the same variables because of
scope rules.  While the compiler is not confused by this naming, it may
be less readable by someone attempting to edit this code.

Signed-off-by: Sean Robinson <[email protected]>
  • Loading branch information
skrobinson committed Oct 27, 2021
1 parent 58777d8 commit 748bc95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,18 +453,18 @@ class Argument {

struct action_apply {
void operator()(valued_action &f) {
std::transform(start, end, std::back_inserter(self.mValues), f);
std::transform(first, last, std::back_inserter(self.mValues), f);
}

void operator()(void_action &f) {
std::for_each(start, end, f);
std::for_each(first, last, f);
if (!self.mDefaultValue.has_value()) {
if (auto expected = self.maybe_nargs())
self.mValues.resize(*expected);
}
}

Iterator start, end;
Iterator first, last;
Argument &self;
};
std::visit(action_apply{start, end, *this}, mAction);
Expand Down

0 comments on commit 748bc95

Please sign in to comment.