mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 07:04:39 +00:00
Rename inner scope variables to differ from outer scope
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 <sean.robinson@scottsdalecc.edu>
This commit is contained in:
parent
58777d8c84
commit
748bc95cf5
@ -453,18 +453,18 @@ public:
|
|||||||
|
|
||||||
struct action_apply {
|
struct action_apply {
|
||||||
void operator()(valued_action &f) {
|
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) {
|
void operator()(void_action &f) {
|
||||||
std::for_each(start, end, f);
|
std::for_each(first, last, f);
|
||||||
if (!self.mDefaultValue.has_value()) {
|
if (!self.mDefaultValue.has_value()) {
|
||||||
if (auto expected = self.maybe_nargs())
|
if (auto expected = self.maybe_nargs())
|
||||||
self.mValues.resize(*expected);
|
self.mValues.resize(*expected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator start, end;
|
Iterator first, last;
|
||||||
Argument &self;
|
Argument &self;
|
||||||
};
|
};
|
||||||
std::visit(action_apply{start, end, *this}, mAction);
|
std::visit(action_apply{start, end, *this}, mAction);
|
||||||
|
Loading…
Reference in New Issue
Block a user