mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
Avoid extra copy made by initializer_list
This commit is contained in:
parent
56c041707a
commit
7dd6655a9e
@ -416,7 +416,7 @@ public:
|
||||
// Parameter packed add_parents method
|
||||
// Accepts a variadic number of ArgumentParser objects
|
||||
template <typename... Targs> void add_parents(const Targs &... Fargs) {
|
||||
for (auto &tParentParser : {Fargs...}) {
|
||||
for (const ArgumentParser &tParentParser : {std::ref(Fargs)...}) {
|
||||
for (auto &tArgument : tParentParser.mPositionalArguments) {
|
||||
auto it =
|
||||
mPositionalArguments.insert(cend(mPositionalArguments), tArgument);
|
||||
|
Loading…
Reference in New Issue
Block a user