From d6610f25948bed563d0250e0ad4e9a72c4461537 Mon Sep 17 00:00:00 2001 From: scorpion-26 <58082714+scorpion-26@users.noreply.github.com> Date: Tue, 21 Mar 2023 22:08:59 +0100 Subject: [PATCH] Config: Support double values --- src/Config.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Config.cpp b/src/Config.cpp index 42e6a64..2a00d72 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -27,6 +27,14 @@ void ApplyProperty(uint32_t& propertyToSet, const std::string_view& va propertyToSet = atoi(valStr.c_str()); } +template<> +void ApplyProperty(double& propertyToSet, const std::string_view& value) +{ + // Why, C++? + std::string valStr = std::string(value); + propertyToSet = std::stod(valStr.c_str()); +} + template<> void ApplyProperty(bool& propertyToSet, const std::string_view& value) {