Commit fab32928 authored by Uwe Woessner's avatar Uwe Woessner
Browse files

fixed print to log file, write went out of scope in MSVC, thus a capture by...


fixed print to log file, write went out of scope in MSVC, thus a capture by value was required (took me a while to figure out)
Signed-off-by: Uwe Woessner's avatarhpcwoess <woessner@hlrs.de>
parent 9b30eee7
...@@ -61,12 +61,12 @@ namespace FlatParameter { ...@@ -61,12 +61,12 @@ namespace FlatParameter {
/// \see openpass::utils::vector::to_string /// \see openpass::utils::vector::to_string
/// \param[in] writer callable collecting the converted value /// \param[in] writer callable collecting the converted value
/// \param[in] delimiter used for vector type (default = ",") /// \param[in] delimiter used for vector type (default = ",")
[[maybe_unused]] static auto to_string(std::function<void(std::string)> writer, const std::string &delimiter = ",") [[maybe_unused]] static auto to_string(std::function<void(const std::string &)> writer, const std::string &delimiter = ",")
{ {
return overload{ return overload{
//[&](std::string &value) { writer(value); }, [&,writer](std::string &value) { writer(value); },
[&](const std::string &value) { writer(value); }, [&,writer](const std::string &value) { writer(value); },
[&](auto &value) { [&,writer](auto &value) {
if constexpr (std::is_arithmetic_v<std::decay_t<decltype(value)>>) if constexpr (std::is_arithmetic_v<std::decay_t<decltype(value)>>)
{ {
writer(std::to_string(value)); writer(std::to_string(value));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment