diff options
author | stoffu <stoffu@protonmail.ch> | 2018-02-26 17:08:02 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-03-05 11:19:04 +0900 |
commit | 450306a01c8fdbb46215a206401a57e49a61508a (patch) | |
tree | 319c557e48a383c889ca0d4ec88ac4f082f17391 /src/common | |
parent | Use `genesis_tx` parameter in `generate_genesis_block`. #3261 (diff) | |
download | monero-450306a01c8fdbb46215a206401a57e49a61508a.tar.xz |
command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/command_line.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/command_line.h b/src/common/command_line.h index f67efcf86..7c48d94e4 100644 --- a/src/common/command_line.h +++ b/src/common/command_line.h @@ -214,8 +214,8 @@ namespace command_line } } - template<typename T, bool required> - bool has_arg(const boost::program_options::variables_map& vm, const arg_descriptor<T, required>& arg) + template<typename T, bool required, bool dependent> + typename std::enable_if<!std::is_same<T, bool>::value, bool>::type has_arg(const boost::program_options::variables_map& vm, const arg_descriptor<T, required, dependent>& arg) { auto value = vm[arg.name]; return !value.empty(); @@ -239,8 +239,8 @@ namespace command_line return vm[arg.name].template as<T>(); } - template<> - inline bool has_arg<bool, false>(const boost::program_options::variables_map& vm, const arg_descriptor<bool, false>& arg) + template<bool dependent> + inline bool has_arg(const boost::program_options::variables_map& vm, const arg_descriptor<bool, false, dependent>& arg) { return get_arg<bool, false>(vm, arg); } |