Create the GncOptionVariant's GncOptionValue in place.

Saves a temporary, prevents premature unprotecting of Scheme objects.
This commit is contained in:
John Ralls 2021-07-19 10:42:24 -07:00
parent c034a26ae7
commit f5d8d508ee

View File

@ -40,8 +40,9 @@ template <typename ValueType,
GncOption::GncOption(const char* section, const char* name,
const char* key, const char* doc_string,
ValueType value, GncOptionUIType ui_type) :
m_option{std::make_unique<GncOptionVariant>(GncOptionValue<ValueType> {
section, name, key, doc_string, value, ui_type})}
m_option{std::make_unique<GncOptionVariant>(
std::in_place_type<GncOptionValue<ValueType>>,
section, name, key, doc_string, value, ui_type)}
{
}