Fix error message in tuple option parsing

This commit is contained in:
Maxime Coste 2015-01-22 13:10:21 +00:00
parent d737929b9e
commit 2516c16bb9

View File

@ -141,7 +141,9 @@ void option_from_string(StringView str, std::tuple<Types...>& opt)
{
auto elems = split(str, tuple_separator, '\\');
if (elems.size() != sizeof...(Types))
throw runtime_error("not enough elements in tuple");
throw runtime_error(elems.size() < sizeof...(Types) ?
"not enough elements in tuple"
: "to many elements in tuple");
TupleOptionDetail<sizeof...(Types)-1, Types...>::from_string(elems, opt);
}