From c3d574ff75f0e4a27c955eff8414efbd08ab159f Mon Sep 17 00:00:00 2001 From: aferrero2707 Date: Sun, 22 Sep 2024 18:39:21 +0200 Subject: [PATCH] [Common] handle std::string types in configuration helper function The `std::string` type was not correctly handled because the standard library does not provide an "identity" override for `std::to_string()` --- Modules/Common/include/Common/Utils.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/Common/include/Common/Utils.h b/Modules/Common/include/Common/Utils.h index 0f7b8b0381..5a84b88a2c 100644 --- a/Modules/Common/include/Common/Utils.h +++ b/Modules/Common/include/Common/Utils.h @@ -89,7 +89,11 @@ T getFromExtendedConfig(const quality_control::core::Activity& activity, const q if (auto param = params.atOptional(name, activity)) { parameter = param.value(); } else { - parameter = params.atOrDefaultValue(name, std::to_string(retVal)); + if constexpr (std::is_same::value) { + parameter = params.atOrDefaultValue(name, retVal); + } else { + parameter = params.atOrDefaultValue(name, std::to_string(retVal)); + } } return internal::stringToType(parameter); }