mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
fix: Fix default bool value print in config definition (#2397)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user