summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2016-12-30 06:43:32 +0000
committerMaxime Coste <mawww@kakoune.org>2016-12-30 06:43:32 +0000
commitea6994dd3b3056b981f13ebb39072fd3dff485bd (patch)
treeecc2d5601843eedd99f4156fbb3e08e6ac857738
parent4f986776423f5cd5fd80a16735f873ae23c10da2 (diff)
Use a struct WorstMatch instead of varargs for the fallback option_add
varargs cannot handle non pod types.
-rw-r--r--src/option_types.hh4
1 files changed, 3 insertions, 1 deletions
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<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");
}