Config: Support double values

This commit is contained in:
scorpion-26 2023-03-21 22:08:59 +01:00
parent 2fa23a2d54
commit d6610f2594

View file

@ -27,6 +27,14 @@ void ApplyProperty<uint32_t>(uint32_t& propertyToSet, const std::string_view& va
propertyToSet = atoi(valStr.c_str()); propertyToSet = atoi(valStr.c_str());
} }
template<>
void ApplyProperty<double>(double& propertyToSet, const std::string_view& value)
{
// Why, C++?
std::string valStr = std::string(value);
propertyToSet = std::stod(valStr.c_str());
}
template<> template<>
void ApplyProperty<bool>(bool& propertyToSet, const std::string_view& value) void ApplyProperty<bool>(bool& propertyToSet, const std::string_view& value)
{ {