Create the GncOptionVariant's GncOptionValue in place.

Saves a temporary, prevents premature unprotecting of Scheme objects.
This commit is contained in:
John Ralls committed 2021-07-31 18:18:05 -07:00
1 parent c034a26ae7
commit f5d8d508ee
1 file changed
+3 -2
+3 -2
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)}
{
}