Skip to content

Commit cdf6cf9

Browse files
committed
Refactor: replace raw loop with a function
1 parent c651133 commit cdf6cf9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

include/argparse.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -810,10 +810,7 @@ namespace argparse
810810
auto consume_args(std::ranges::view auto args) const -> std::vector<std::any>
811811
{
812812
std::vector<std::any> values;
813-
for (auto & arg : args)
814-
{
815-
values.push_back(consume_arg(arg));
816-
}
813+
std::ranges::copy(std::views::transform(args, [this](auto & arg) { return consume_arg(arg); }), std::back_inserter(values));
817814
return values;
818815
}
819816

0 commit comments

Comments
 (0)