fix: Fix default bool value print in config definition (#2397)

This commit is contained in:
Ayaz Salikhov
2025-08-06 11:51:15 +01:00
committed by GitHub
parent cfffbfba9d
commit 156b858db7
2 changed files with 14 additions and 14 deletions

View File

@@ -19,6 +19,8 @@
#include "util/config/Types.hpp"
#include "util/OverloadSet.hpp"
#include <cstdint>
#include <ostream>
#include <string>
@@ -51,15 +53,13 @@ operator<<(std::ostream& stream, ConfigType type)
std::ostream&
operator<<(std::ostream& stream, Value value)
{
if (std::holds_alternative<std::string>(value)) {
stream << std::get<std::string>(value);
} else if (std::holds_alternative<bool>(value)) {
stream << (std::get<bool>(value) ? "False" : "True");
} else if (std::holds_alternative<double>(value)) {
stream << std::get<double>(value);
} else if (std::holds_alternative<int64_t>(value)) {
stream << std::get<int64_t>(value);
}
std::visit(
util::OverloadSet{
[&stream](bool const& val) { stream << (val ? "True" : "False"); },
[&stream](auto const& val) { stream << val; }
},
value
);
return stream;
}