c++11 compatibility fix

This commit is contained in:
bartosz_sobol 2019-06-27 11:48:06 +02:00
parent 384f8dab93
commit 68ba889809

View File

@ -1223,10 +1223,24 @@ namespace cxxopts
struct Option struct Option
{ {
std::string opts; Option
std::string desc; (
std::shared_ptr<const Value> value = ::cxxopts::value<bool>(); const std::string& opts,
std::string arg_help = ""; const std::string& desc,
const std::shared_ptr<const Value>& value = ::cxxopts::value<bool>(),
const std::string& arg_help = ""
)
: opts_(opts)
, desc_(desc)
, value_(value)
, arg_help_(arg_help)
{
}
std::string opts_;
std::string desc_;
std::shared_ptr<const Value> value_;
std::string arg_help_;
}; };
class Options class Options
@ -1544,7 +1558,7 @@ Options::add_options
OptionAdder option_adder(*this, group); OptionAdder option_adder(*this, group);
for (const auto &option: options) for (const auto &option: options)
{ {
option_adder(option.opts, option.desc, option.value, option.arg_help); option_adder(option.opts_, option.desc_, option.value_, option.arg_help_);
} }
} }