From 328f1048da070f79d41e5fbdc978de723f01244e Mon Sep 17 00:00:00 2001 From: Stephan van Veen Date: Thu, 9 May 2019 17:42:18 +0200 Subject: [PATCH] Initialize mNames using --- include/argparse.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/argparse.hpp b/include/argparse.hpp index 551ef64..bdbcc87 100644 --- a/include/argparse.hpp +++ b/include/argparse.hpp @@ -90,7 +90,7 @@ public: Argument() = default; template - Argument(Args... args) + explicit Argument(Args... args) : mNames({std::move(args)...}) , mIsOptional((is_optional(args) || ...)) {} @@ -301,7 +301,7 @@ class ArgumentParser { // Call add_argument with variadic number of string arguments template Argument& add_argument(Targs... Fargs) { - std::shared_ptr tArgument = std::make_shared(Fargs...); + std::shared_ptr tArgument = std::make_shared(std::move(Fargs)...); if (!tArgument->mIsOptional) mPositionalArguments.push_back(tArgument);