mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-03 22:54:39 +00:00
Declare lambda parameter and ArgumentParser::print_help as const
These were respectively reported as constParameter and functionConst style issues by cppcheck. Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This commit is contained in:
parent
6530a06747
commit
abb2206141
@ -453,7 +453,7 @@ public:
|
||||
mUsedName = usedName;
|
||||
if (mNumArgs == 0) {
|
||||
mValues.emplace_back(mImplicitValue);
|
||||
std::visit([](auto &aAction) { aAction({}); }, mAction);
|
||||
std::visit([](const auto &aAction) { aAction({}); }, mAction);
|
||||
return start;
|
||||
} else if (mNumArgs <= std::distance(start, end)) {
|
||||
if (auto expected = maybe_nargs()) {
|
||||
@ -1049,7 +1049,7 @@ public:
|
||||
// Printing the one and only help message
|
||||
// I've stuck with a simple message format, nothing fancy.
|
||||
[[deprecated("Use cout << program; instead. See also help().")]] std::string
|
||||
print_help() {
|
||||
print_help() const {
|
||||
auto out = help();
|
||||
std::cout << out.rdbuf();
|
||||
return out.str();
|
||||
|
Loading…
Reference in New Issue
Block a user