From ea6994dd3b3056b981f13ebb39072fd3dff485bd Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 30 Dec 2016 06:43:32 +0000 Subject: [PATCH] Use a struct WorstMatch instead of varargs for the fallback option_add varargs cannot handle non pod types. --- src/option_types.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/option_types.hh b/src/option_types.hh index 3b5799dd..fd6b3b14 100644 --- a/src/option_types.hh +++ b/src/option_types.hh @@ -214,7 +214,9 @@ inline bool option_add(StronglyTypedNumber& opt, return val != 0; } -inline bool option_add(...) +struct WorstMatch { template WorstMatch(T&&) {} }; + +inline bool option_add(WorstMatch, StringView str) { throw runtime_error("no add operation supported for this option type"); }