diff --git a/include/CLI.hpp b/include/CLI.hpp index 7bf0278c..a07bec3d 100644 --- a/include/CLI.hpp +++ b/include/CLI.hpp @@ -42,11 +42,12 @@ namespace detail { } constexpr detail::enabler dummy = {}; -template -using EnableIf = typename std::enable_if::type; -template -using DisableIf = typename std::enable_if::type; +// Copied from C++14 +// template< bool B, class T = void > +// using enable_if_t = typename std::enable_if::type; +template +using EnableIf = typename std::enable_if::type; struct Combiner { int num; @@ -264,7 +265,7 @@ public: }; -template> = dummy> +template::value> = dummy> bool lexical_cast(std::string input, T& output) { logit("Int lexical cast " + input); try{ @@ -277,7 +278,7 @@ bool lexical_cast(std::string input, T& output) { } } -template> = dummy> +template::value> = dummy> bool lexical_cast(std::string input, T& output) { logit("Floating lexical cast " + input); try{ @@ -292,7 +293,7 @@ bool lexical_cast(std::string input, T& output) { // String and similar template::value && !std::is_integral::value, detail::enabler>::type = dummy> +EnableIf::value && !std::is_integral::value> = dummy> bool lexical_cast(std::string input, T& output) { logit("Direct lexical cast: " + input); output = input; @@ -383,7 +384,7 @@ public: } /// Add option for string - template> = dummy> + template::value> = dummy> void add_option( std::string name, ///< The name, long,short T &variable, ///< The variable to set @@ -447,7 +448,7 @@ public: } /// Add option for flag - template> = dummy> + template::value> = dummy> void add_flag( std::string name, ///< The name, short,long T &count, ///< A varaible holding the count