Skip to content

Commit

Permalink
Fix unused argument warnings.
Browse files Browse the repository at this point in the history
Solution suggested by skrobinson. This way, GCC and clang-tidy don't
generate warnings.

Fixes: #167
  • Loading branch information
ericonr committed Apr 19, 2022
1 parent 2312342 commit 5c5c55b
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 @@ -148,7 +148,7 @@ constexpr bool standard_integer =

template <class F, class Tuple, class Extra, std::size_t... I>
constexpr decltype(auto) apply_plus_one_impl(F &&f, Tuple &&t, Extra &&x,
std::index_sequence<I...> unused) {
std::index_sequence<I...> /*unused*/) {
return std::invoke(std::forward<F>(f), std::get<I>(std::forward<Tuple>(t))...,
std::forward<Extra>(x));
}
Expand Down Expand Up @@ -855,7 +855,7 @@ class ArgumentParser {
: m_program_name(std::move(program_name)), m_version(std::move(version)) {
if ((add_args & default_arguments::help) == default_arguments::help) {
add_argument("-h", "--help")
.action([&](const auto &unused) {
.action([&](const auto &/*unused*/) {
std::cout << help().str();
std::exit(0);
})
Expand All @@ -866,7 +866,7 @@ class ArgumentParser {
}
if ((add_args & default_arguments::version) == default_arguments::version) {
add_argument("-v", "--version")
.action([&](const auto &unused) {
.action([&](const auto &/*unused*/) {
std::cout << m_version << std::endl;
std::exit(0);
})
Expand Down

0 comments on commit 5c5c55b

Please sign in to comment.