From b1187cf91dc0faeb54e3bab7b1c6fb84fe0a4a43 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 24 Jul 2018 20:20:51 +1000 Subject: [PATCH] Quote every option type but integral types Opt-in quoting was a bad choice, lets default to opt-out with all integral types non quoted. --- src/option.hh | 2 +- src/string_utils.hh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/option.hh b/src/option.hh index fd2de5c5..bf838c71 100644 --- a/src/option.hh +++ b/src/option.hh @@ -45,7 +45,7 @@ option_add_from_strings(T& opt, ConstArrayView strs) template constexpr bool option_needs_quoting(Meta::Type) { - return false; + return not std::is_integral::value; } template diff --git a/src/string_utils.hh b/src/string_utils.hh index 0a6c2594..558ba62f 100644 --- a/src/string_utils.hh +++ b/src/string_utils.hh @@ -68,7 +68,6 @@ Optional str_to_int_ifp(StringView str); inline String option_to_string(StringView opt) { return opt.str(); } inline String option_from_string(Meta::Type, StringView str) { return str.str(); } inline bool option_add(String& opt, StringView val) { opt += val; return not val.empty(); } -constexpr bool option_needs_quoting(Meta::Type) { return true; } template struct InplaceString