Skip to content

Commit

Permalink
[Common] handle std::string types in configuration helper function
Browse files Browse the repository at this point in the history
The `std::string` type was not correctly handled because the standard
library does not provide an "identity" override for `std::to_string()`
  • Loading branch information
aferrero2707 committed Sep 22, 2024
1 parent 3b31948 commit c3d574f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Modules/Common/include/Common/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string, T>::value) {
parameter = params.atOrDefaultValue(name, retVal);
} else {
parameter = params.atOrDefaultValue(name, std::to_string(retVal));
}
}
return internal::stringToType<T>(parameter);
}
Expand Down

0 comments on commit c3d574f

Please sign in to comment.