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.
This commit is contained in:
Maxime Coste 2018-07-24 20:20:51 +10:00
parent 5f825cf0f5
commit b1187cf91d
2 changed files with 1 additions and 2 deletions

View File

@ -45,7 +45,7 @@ option_add_from_strings(T& opt, ConstArrayView<String> strs)
template<typename T>
constexpr bool option_needs_quoting(Meta::Type<T>)
{
return false;
return not std::is_integral<T>::value;
}
template<typename P, typename T>

View File

@ -68,7 +68,6 @@ Optional<int> str_to_int_ifp(StringView str);
inline String option_to_string(StringView opt) { return opt.str(); }
inline String option_from_string(Meta::Type<String>, 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<String>) { return true; }
template<size_t N>
struct InplaceString