Use a struct WorstMatch instead of varargs for the fallback option_add

varargs cannot handle non pod types.
This commit is contained in:
Maxime Coste 2016-12-30 06:43:32 +00:00
parent 4f98677642
commit ea6994dd3b

View File

@ -214,7 +214,9 @@ inline bool option_add(StronglyTypedNumber<RealType, ValueType>& opt,
return val != 0;
}
inline bool option_add(...)
struct WorstMatch { template<typename T> WorstMatch(T&&) {} };
inline bool option_add(WorstMatch, StringView str)
{
throw runtime_error("no add operation supported for this option type");
}