Throw an exception if one tries to set a GncOption with an unsupported type.

This commit is contained in:
John Ralls
2019-10-12 18:10:43 -07:00
parent c5fac51a8b
commit e51faff3e3

View File

@@ -418,6 +418,11 @@ private:
}
template <class OptionType>
void operator()(OptionType& option) const {
std::string msg{"Attempt to set option of type "};
msg += typeid(OptionType).name();
msg += " with value of type ";
msg += typeid(m_value).name();
throw std::invalid_argument(msg);
}
private:
ValueType m_value;