mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-05 07:34:40 +00:00
Annotate range-for loops' structured bindings as [[maybe_unused]]
The 'unused' variable in both cases is most-definitely unused in the loop. This is a cppcheck warning that appeared after moving these two loops to range-for. Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This commit is contained in:
parent
843e4eefb0
commit
67d2e4476f
@ -959,7 +959,7 @@ public:
|
||||
void parse_args(const std::vector<std::string> &arguments) {
|
||||
parse_args_internal(arguments);
|
||||
// Check if all arguments are parsed
|
||||
for (const auto& [unused, argument] : m_argument_map) {
|
||||
for ([[maybe_unused]] const auto& [unused, argument] : m_argument_map) {
|
||||
argument->validate();
|
||||
}
|
||||
}
|
||||
@ -1143,7 +1143,7 @@ private:
|
||||
return 0;
|
||||
}
|
||||
std::size_t max_size = 0;
|
||||
for (const auto& [unused, argument] : m_argument_map) {
|
||||
for ([[maybe_unused]] const auto& [unused, argument] : m_argument_map) {
|
||||
max_size = std::max(max_size, argument->get_arguments_length());
|
||||
}
|
||||
return max_size;
|
||||
|
Loading…
Reference in New Issue
Block a user